Closed mattrunyon closed 3 years ago
Why is this a problem?
I guess Chrome writes some kind of caches or other data. You would probably have the same behavior if using Chrome manually, especially opening/closing many tabs all the time like SM does.
I haven't monitored it longer than a few minutes yet, but yesterday after running it for 2 days it was maxing my SSD I/O to the point I had to forcibly shut down the VM. The SSD is just a data drive on the host OS and wasn't being used.
It's a problem because it will cause people's drives to die early. I think it wrote a couple TBs of data in just 2 days from what crystal disk info shows. It also made my SSD hit 50C sustained temp when it normally hovers at 28-30C.
In addition to early drive failure, it may cause slowdowns to people's systems. When I tried to read a file from the disk that the VM uses for it's virtual disk, it took 10s+ to load
It might be more of a problem with puppeteer. Normally using chrome doesn't cause any sorts of writes like this. I've seen peaks of 450MB/s for a few seconds indicating it's writing 1GB of data in that time.
Normally using chrome doesn't cause any sorts of writes like this.
But SM is not normal usage. It is opening hundreds of pages per minute.
It's a problem because it will cause people's drives to die early.
Still cheaper than buying GPUs from scalpers :D
For me it is like this, 50 MB/s max, 8 stores. Maybe +0.1 TB after 2-3 hours.
https://user-images.githubusercontent.com/5680466/115074488-6d73f900-9f02-11eb-8811-b71d7e34c72b.mp4
One way to minimize disk writes is to stop SM when it is not likely to be useful, like at night or maybe even outside of working hours when most stores probably will not update.
Also maybe check VM/OS config, add more RAM if needed, disable swap if enabled, etc.
fatrace
says that indeed lots of some chrome cache-related files are written.
https://user-images.githubusercontent.com/5680466/115076586-70241d80-9f05-11eb-8b09-a14c2047d8b6.mp4
Weird when I run it on my main Windows install it peaks at 10MB/s or so with the same settings. Gonna try in a Windows VM next to see if it's related to Hyper-V or if it might be some weird Ubuntu setting/setup.
As a temporary fix I've mounted /tmp as a ramdisk using tmpfs which reduces the writes to 0 since it seems to be writing only to /tmp.
Still not sure why it's writing so much on Ubuntu in Hyper-V and significantly less in Windows 10.
Still not sure why it's writing so much on Ubuntu in Hyper-V and significantly less in Windows 10.
I think Linux disk i/o is supposed to be more efficient than on Windows, so maybe that's why Chrome on Linux caches to disk more aggressively.
Also maybe it depends on the amount of RAM available.
As a temporary fix I've mounted /tmp as a ramdisk using tmpfs
Why temporary? Sounds like a good idea unless you do not have enough RAM, but for me it does not seem to exceed 400-500MB.
Why temporary? Sounds like a good idea unless you do not have enough RAM, but for me it does not seem to exceed 400-500MB.
Guess I should say it's a permanent fix for me lol. Probably not a better way around it as it's most likely due to puppeteer if I had to guess.
For anybody here in the future, I added this to my /etc/fstab to mount /tmp as tmpfs (RAM disk) on boot
tmpfs /tmp tmpfs rw,nosuid,nodev
Seems to be running fine w/ 4GB RAM on Ubuntu desktop 18.04. Uses around 2-3GB. Could probably drop to 2GB if using a lighter desktop than Ubuntu 18's default or no desktop environment at all.
Expected Behavior
Disk read/write should be minimal.
Current Behavior
Disk usage has frequent bursts of 100MB/s+ writes when street merchant is running. With street merchant not running, never goes above 100 kB/s writes
Steps to Reproduce
I am running street merchant with
npm start
Environment
Ubuntu 18.04 VM on a Hyper-V VM in Windows 10. VM has 8GB RAM allocated and 2 vCPUs. Hyper-V smart paging file is set to a different drive than the drive containing the virtual hard disk. Virtual hard disk is 20GB.
Logs
Can't find any info on where logs are stored, but using iotop, jdb2 and puppeteer are the offenders.