ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.22k stars 174 forks source link

Steam - Unstable download speeds (Busy writing to disk) #3450

Open CommanderAlchemy opened 10 years ago

CommanderAlchemy commented 10 years ago

Right so I noticed that native steam client got issues when downloading and giving "Busy writing to disk" Searched for it and noticed that this is a limit to my harddrive. However i noticed that it does not happen when running Windows client in Wine.

Both clients are downloading to a Western Digital Caviar Black 1TB harddrive running EXT4. I get no warnings that the drive is busy when running wine client. Also the tried it twice on each client and the results was the same as shown below.

Nothing else is running on that drive and the only files are the steamapps from those clients.

Steam Linux

1ad

Steam system info: https://gist.github.com/CommanderAlchemy/83c70f2deffb678192c3

Steam Wine

1ad

Steam system info (wine): https://gist.github.com/CommanderAlchemy/6847b1fc1080c77be86a

gdrewb-valve commented 10 years ago

I think people have noticed this on Windows also.

timss commented 10 years ago

@CommanderAlchemy Sorry for being off topic, you had no email on Github I could use instead. Is that a custom version of the Steam client? I haven't seen anything similar, and I'm running a fairly updated native Steam beta on Linux. I thought Steam skins were something of the past. Thanks.

Edit: Initially didn't have much luck through Google, but found something very interesting after a retry: Steam Skins - 2010 UI - Updated 17 August 2014.

CommanderAlchemy commented 10 years ago

@timss No worries, its a skin. http://forums.steampowered.com/forums/showthread.php?t=2196090

timss commented 10 years ago

@CommanderAlchemy Thanks.

TheRealCuran commented 10 years ago

The reason for this – at least on Linux – is most likely that Steam is using fsync too aggressively. Mix that with the write barrier support of Ext4 (not necessarily the file system, if you use ext4 for reading/writing to ext3/2, then you'll see the problem there as well) and you get very poor writing performance. Just check what iotop says and you'll find jbd2 at the very top.

The solution is: less aggressive fsync

A workaround: remount your file system with barrier=0 when you run Steam.

(For reference, see kernel bug #42895, especially Theodore Ts’o's comments.)

CommanderAlchemy commented 10 years ago

@TheRealCuran Yeah seems you right. Will try your workarround.

Steam Native

warpout1

Steam Wine

warpout1

shoober420 commented 9 years ago

I switched my file system from ext2 to ext4, added the "barrier=0" to my fstab options, and I still have slow downloads, until they completely stop seconds later. I think this has something to do with how Steam aggressively calls out the DNS. Someone mentioned that using a package called "dnsmasq" would fix this, but I couldn't get it to work. I will try dnsmasq again.

But anyway, PLEASE VALVE FIX THIS PROBLEM!!! I CAN'T DOWNLOAD MY GAMES!!!

aiqueneldar commented 9 years ago

I am experiencing the same issue. I have seen this in som older tickets specially in #3510. My symptoms are that I try to download a game to be installed on linux. The client downloads som data then gets stuck in writing to disk. Ages go by where most of the GUI in the steam client freezes up.

I have seen that many people suggest that Steam is just busy with IO. So I looked at the process specfic IO and overall disk IO. None are even close to be at full throtle. The steam process who manages the IO for the game sometimes tuches 99.99% of all disk IO whis is about 130 KB/s never above 150 KB/s. Same goes for jbd2. It does go up to 99.99% more frequent. But I would hardly say all the time. Quite literary half the time there is no IO going in for any process.

So I also looked at the overall disk IO:

Total DISK READ :       0.00 B/s | Total DISK WRITE :     102.82 K/s
Actual DISK READ:       0.00 B/s | Actual DISK WRITE:     125.67 K/s

This is a snapchot copy+pasted from iotop but showes what a most values are when they are not 0.

I then used gkrellm to monitor the specifik partition I use for my Steam install (sda2) and to have something to compare i simply used my entire main disk (sdc). I also setup alerts to show a warning if IO rose above 30 KB/s for more than 1 secund. And an Error if it rose above 40 KB/s for more than 1 secund. I do get the alert, but rarley. About maby two that blinks past in the timespan of 1 minute.

I also noticed that when I pause the download, and have started Steam from a terminal, I get loats of these errors before the download goes into paused mode:

/home/buildbot/buildslave_steam/steam_rel_client_ubuntu12_linux/build/src/tier1/../tier1/fileio.cpp (2965) : Assertion Failed: Failed to determine free disk space for <path to sda2 folder for Steam. Omitted>, error 2

I have seen quite a few of these googling the internet, but no real fix. Least not one that works for me. My disk is local, mounted with barrier=0. Not symlinked in any way. Running an ext4 filesystem that has about 1.3 TB of free space, 4.4 GB of used and is solely used for Steam games.

I tried to test if the disk would show similar bad performance with other tasks, so I used caja to simply copy a folder containing about 13 GB of data in a couple of files. Result below: PID PRIO USER DISK READ DISK WRITE SWAPIN IO COMMAND
4859 be/4 *** 62.38 M/s 62.44 M/s 0.00 % 82.08 % caja -n [pool]

Downloaded and setup steam windows client with wine. Got same download speeds and same symptom of it getting stuck in Writing to disk, while iotop shows that not particulary much is happening on the disk.

Below is my System information running Steam client API v017, package version 1419038262. It is beta, but I have already tried stable, and gives exactly the same symptoms.

Processor Information:
    Vendor:  AuthenticAMD
    CPU Family:  0x15
    CPU Model:  0x1
    CPU Stepping:  0x2
    CPU Type:  0x0
    Speed:  3100 Mhz
    8 logical processors
    8 physical processors
    HyperThreading:  Unsupported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Supported
    SSE4a:  Supported
    SSE41:  Supported
    SSE42:  Supported

Network Information:
    Network Speed:  

Operating System Version:
    Linux Mint 17 Qiana (64 bit)
    Kernel Name:  Linux
    Kernel Version:  3.13.0-24-generic
    X Server Vendor:  The X.Org Foundation
    X Server Release:  11501000
    X Window Manager:  Marco
    Steam Runtime Version:  steam-runtime-release_2014-11-14

Video Card:
    Driver:  NVIDIA Corporation GeForce GTX 660 Ti/PCIe/SSE2

    Driver Version:  4.4.0 NVIDIA 331.113
    OpenGL Version: 4.4
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 60 Hz
    VendorID:  0x10de
    DeviceID:  0x1183
    Number of Monitors:  3
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1920 x 1080
    Desktop Resolution: 5520 x 1080
    Primary Display Size: 14,49" x 8,15"  (16,61" diag)
                                            36,8cm x 20,7cm  (42,2cm diag)
    Primary Bus: PCI Express 16x
    Primary VRAM: 2048 MB
    Supported MSAA Modes:  2x 4x 8x 16x 

Sound card:
    Audio device: Realtek ALC892

Memory:
    RAM:  32105 Mb

Miscellaneous:
    UI Language:  English
    LANG:  en_US.UTF-8
    Microphone:  Not set
    Total Hard Disk Space Available:  74512 Mb
    Largest Free Hard Disk Block:  41693 Mb

Installed software:

Recent Failure Reports:
    Fri Dec 19 22:12:11 2014 GMT: file ''/tmp/dumps/assert_20141219231119_56.dmp'', upload yes: ''CrashID=bp-29812d3b-ad3b-4183-9e11-d7bf62141219''
    Sat Dec 20 00:53:20 2014 GMT: file ''/tmp/dumps/assert_20141220015308_31.dmp'', upload yes: ''CrashID=bp-8d0fe1be-2cd8-4a72-93b9-20a302141219''
    Sat Dec 20 02:24:44 2014 GMT: file ''/tmp/dumps/assert_20141220032423_29.dmp'', upload yes: ''CrashID=bp-32ac290c-02b1-4d64-8baa-925c22141219''
    Sat Dec 20 02:43:09 2014 GMT: file ''/tmp/dumps/assert_20141220034300_64.dmp'', upload yes: ''CrashID=bp-b7f34cf6-aa3e-4eec-9bb9-6595c2141219''
    Sat Dec 20 02:46:32 2014 GMT: file ''/tmp/dumps/assert_20141220034625_86.dmp'', upload yes: ''CrashID=bp-3991969d-e84d-40f7-a849-a2bfb2141219''
    Sat Dec 20 02:59:43 2014 GMT: file ''/tmp/dumps/assert_20141220035936_41.dmp'', upload yes: ''CrashID=bp-bcc16aa9-8ee1-4f46-888f-a1cb22141219''
    Sat Dec 20 03:56:15 2014 GMT: file ''/tmp/dumps/assert_20141220045603_40.dmp'', upload yes: ''CrashID=bp-692514b4-a58c-4d03-b67d-8bae82141219''
aiqueneldar commented 9 years ago

I forgot in my previous super-comment; @shoober420

Someone mentioned that using a package called "dnsmasq" would fix this, but I couldn't get it to work. I will try dnsmasq again.

I have tried this as well. I have dnsmasq (full, caching enabled one) up and running. And yes, it does fix the issue where it takes 1 min a click when you are browsing in the Store part of the Steam client. Also, updating the client itself goes really fast. The whole update download tok a couple of seconds. Not sure if this is just working, or if it is working as a result of dnsmasq.

However dnsmasq does not improve downloading games. Mainly because what it does is to cache DNS querys locally on your macinge. And downloading the data is not the problem in this case. When my Steam client is actually downloading I get great speeds. But since the problem is somewhere in the "write and fix data onto the disk" department I have a hard time seeing dnsmasq fixing it.

But if you get it up and running and it solves your issue I sure would like som notes on what you did.

Plaque-fcc commented 9 years ago

Well, all I know is that there are at least two bug reports about low download speed (#2573, #3531), one about high CPU (97..110%) usage (#3471), and now this one is about both. It all affects me, so that's why I post my +1 and mention here all those I found.

aiqueneldar commented 9 years ago

I just made an interesting discovery. I have installed the steam client and all its libraries to my main system disk. But it is a really small disk (80 GB, it has been my system disk for a VERY long time).

Now I tried to download a new game I just bought from the store. And then instead of choosing my large 1.3TB partiotion that I have set aside for games on another disk (that is not symlinked, bind mounted or anything and has the barrier=0 option. I choosed to download to default media directory. And everything worked as a charme.

Not sure if downloading to you default media riectory is the trick or if it was downloading to the same disk the Steam library and binaries are on is the trick. I will try reinstalling it all on the larger disk and see if it still works if steam client is installed on another disk than the system disk.

But there you have one posible solution. Make sure you use default media directory. You can add more in Steam -> Settings -> Downloads -> "STEAM LIBRARY FOLDERS". Make sure there is only the default folder in there. And that folder should not be symlinked, bind mounted or anything. Just regular folders on the same partition.

CommanderAlchemy commented 9 years ago

if catching dns helps then you guys have slow DNS providers. Try the google dns or some other provider that got better latency.

aiqueneldar commented 9 years ago

It's not a problem of slow dns replies. It's a problem where Steam uses DNS lookups for every single connection. Resulting in its own unintentional DOS-attack agains your ISP by sending as much as several thousands of requests a second. Most ISPs just shut you down then. And that is why you start experiencing drop in download speed, and slow browsing within steam store.

When you add a DNS cach all those thounsands of lookups just hits you own machine and gets a reply in almost 0 ms. Instead of about 40 ms. When we are talking thounsends of hits a sekund that means a great performance boost if you get closer to 0 ms answer times.

Plaque-fcc commented 9 years ago

if catching dns helps then you guys have slow DNS providers. Try the google dns or some other provider that got better latency.

This didn't help me. And yes, how many requests per, say, 200 MB download should Steam Client be attempting to get so much slow that DNS caching could help?

I guess, this is not related to DNS repeaters efficiency, it's about Steam Client efficiency. And again, why not merging it into #2573?

CommanderAlchemy commented 9 years ago

I guess, this is not related to DNS repeaters efficiency, it's about Steam Client efficiency. And again, why not merging it into #2573?

From what i can se that post is not about same issue. This issue is about download speeds yes but i'm getting BUSY WRITING TO DISK and high jbd2 usage.

While downloading I also tried to go into store and while the download speeds crashed i can look through the store without any difference in loading speeds. (Im using google DNS, but no difference in using my ISP DNS)

I don't think this particular issue is related to DNS.

Just tried the Steam on Wine to download the same game with the same results.

Native ~0-12MB/S with breaks and BUSY WRITING TO DISK warnings. Wine ~10-22MB/S no breaks or BUSY warnings. Same harddrive, same filesystem, same partition, only different folder and client.

shoober420 commented 9 years ago

I found out my problem was that I have a host file that blocks advertising IPs, which included Steam servers. After removing the host file, it worked.

krasnoglaz commented 9 years ago

I have the same issue with ext4.

m0skit0 commented 9 years ago

Same problem here as well (ext4)

screenshot from 2015-03-03 15 18 53 screenshot from 2015-03-03 15 20 01

Downloading any game takes forever (and I have a 100MB line). This is now 6-months old and no news... We all appreciate your efforts to bring Steam to Linux but this needs a fix ASAP.

Ape commented 9 years ago

There is a workaround for this issue. You can just run eatmydata steam. It replaces fsync with a no-operation.

https://www.flamingspork.com/projects/libeatmydata/

EDIT: This actually didn't work since steam is launched with a script that manipulates LD_PRELOAD. Any ideas how to make this work?

EDIT2: This does work. I just needed to run eatmydata32 steam since steam is 32-bit binary.

danutchereches commented 8 years ago

This is very much still an issue.

NishaYume commented 7 years ago

news about this issue? Im downloading at 6 kb/s?

steamlinux commented 7 years ago

about disk activity... when steam download new game, disk activity normal when already installed download some updates, disk activity load at 95-100% (i look via iotop) and PC have freezes my fs ext4 with journaling

DanielRios549 commented 5 years ago

I'm having something like that. The games starts do download normally, but it is unstable too much, increasing and decreasing all the time, like a stair... image

Ape commented 5 years ago

@DanielRios549 How much CPU usage are you seeing? The decompression algorithm might be the bottleneck here.

NicTanghe commented 4 years ago

aren't those normal speeds for harddrives seeing as hard drives are slow and if you dl i need s o write.

germaniii commented 3 years ago

Do you guys, by any chance ran Virtual Machine Manager / KVM before? I noticed this just now, I set the Virtual Network to active and also checked the boxed for it to activate on boot sometime ago. image

After disabling it, I can see my downloads didn't go all crazy looking like valleys going up and down anymore. The disk usage and download speed finally matched, not like before where the download speed would halt because the I/O can't keep up. image

Also, the JBD2 process doesn't even reach 50% anymore image