Hi, I am a server admin for factorio server.
Recently I found that Factorio DS are quite strange in saving saves. It take **much** longer on cloud server (aliyun) rather than bare mental machines.
After investigating, Factorio DS seems like using fsync syscall to ensure saves are written to disk (which is good).
What stranges me most is cloud server's monitor table shows disk IOPS and throughput is little used. And I can't figure out why.
So is there any advice about this?
P.S.
I wish I could have a button to enable non fsync syscall to save the save.
EDIT: I have async save off.
Factorio Dedicated Server Disk IO Patten?
- hanyuwei70
- Burner Inserter
- Posts: 11
- Joined: Sun Mar 04, 2018 9:35 am
- Contact:
Factorio Dedicated Server Disk IO Patten?
Last edited by hanyuwei70 on Wed Apr 12, 2023 5:57 am, edited 1 time in total.
- hanyuwei70
- Burner Inserter
- Posts: 11
- Joined: Sun Mar 04, 2018 9:35 am
- Contact:
Re: Factorio Dedicated Server Disk IO Patten?
I found something interesting.
on cloud server, my disk works like this
on my bare mental server
seems like disk io latency played a important role in saving speed.
could devs optimize these?
on cloud server, my disk works like this
Code: Select all
# dd if=/dev/zero of=test1.img bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 8.65808 s, 124 MB/s
# dd if=/dev/zero of=test2.img bs=512 count=1000 oflag=dsync
1000+0 records in
1000+0 records out
512000 bytes (512 kB, 500 KiB) copied, 1.1676 s, 439 kB/s
Code: Select all
%dd if=/dev/zero of=test2.img bs=512 count=1000 oflag=dsync
1000+0 records in
1000+0 records out
512000 bytes (512 kB, 500 KiB) copied, 0.194241 s, 2.6 MB/s
%dd if=/dev/zero of=test1.img bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.87952 s, 220 MB/s
could devs optimize these?
Re: Factorio Dedicated Server Disk IO Patten?
First: Do you have async save on or off in the config? Did you try both?
Secondly you should look what IO Pattern the saving actually takes before assuming latency is an issue at all. Doing an fsync() after a 1GB save file once and adding 1s of latency to that will hardly matter.
Secondly you should look what IO Pattern the saving actually takes before assuming latency is an issue at all. Doing an fsync() after a 1GB save file once and adding 1s of latency to that will hardly matter.
- hanyuwei70
- Burner Inserter
- Posts: 11
- Joined: Sun Mar 04, 2018 9:35 am
- Contact:
Re: Factorio Dedicated Server Disk IO Patten?
I have async save off due to experimental.mrvn wrote: ↑Tue Apr 11, 2023 11:42 pmFirst: Do you have async save on or off in the config? Did you try both?
Secondly you should look what IO Pattern the saving actually takes before assuming latency is an issue at all. Doing an fsync() after a 1GB save file once and adding 1s of latency to that will hardly matter.
How to deliberately add latency to disk IO in Linux? using qemu?