cpu hogs killing vps performance?
so we upgrade to a 128 (for various reasons), but the same thing still happens. i try to do small updates at a time, but the problem is that whenever i run 1 cpu (and disk intensive?) process the whole systems seems to wait for it to finish.
i don't upgrade during peak hours, but i'm still worried that if someone hits one of my web pages during an update, they'll give up before it loads.
i've tried renicing dselect/apt-get, and that seems to help, but they just seem to "share" poorly in general.
has anyone else experienced this or am i crazy? is dselect/apt known for bring systems to a crawl? (i've usually a slackware user)
or here's my crazy theory: is it a UML process scheduling problem? it just seems like the process scheduler lets intensive processes hog the system while light-weights just have to wait for the big boys to finish.
has anyone (caker?
thanks in advance for any insight!
13 Replies
cat /proc/io_status
Adam
Sorry couldn't really help there, but I thought you'll be interested to know it.
cheers, HS
@untitled9:
so originally had a linode 96. whenever i installed packages the system would come to a standstill. in fact some web pages wouldn't even load until a package had finished installing.
so we upgrade to a 128 (for various reasons), but the same thing still happens. i try to do small updates at a time, but the problem is that whenever i run 1 cpu (and disk intensive?) process the whole systems seems to wait for it to finish.
i don't upgrade during peak hours, but i'm still worried that if someone hits one of my web pages during an update, they'll give up before it loads.
i've tried renicing dselect/apt-get, and that seems to help, but they just seem to "share" poorly in general.
has anyone else experienced this or am i crazy? is dselect/apt known for bring systems to a crawl? (i've usually a slackware user)
or here's my crazy theory: is it a UML process scheduling problem? it just seems like the process scheduler lets intensive processes hog the system while light-weights just have to wait for the big boys to finish.
has anyone (caker?
;) ) experimented with UML's process scheduling? i know that process scheduling in general is a hot topic in the linux kernel.thanks in advance for any insight!
i've never looked at /proc/io_status before. in an idle state mine looks like:
io_count=14628131 io_rate=0 io_tokens=400000 token_refill=512 token_max=400000
care to give a short explanation of what these numbers mean? also, if IOs the bottleneck what can i tweak? is there a place in /proc to adjust file caching/buffering?
i've worked with linux for a long time, but never tweaked a kernel before. considering i may be doubling the number of users on my linode soon, i feel like i should get educated!
iocount=14628131 iorate=0 iotokens=400000 tokenrefill=512 token_max=400000
````
io_count, is the number of IO operations since boot.
io_rate, is the current IO usage
io_tokens, is the number of io tokens you have available
tokenrefill, is how many tokens get added to the iotokens count every second
token_max, is the maximum number of io tokens you can have.
It works the same way ip tables buckets work.
The only time you should really get IO problems is when you are hitting the swap alot. You can use vmstat is look at that.
To monitor IO usage which you are doing apt-get use
watch cat /proc/io_status
Adam
i ran watch -n 1 cat /proc/io_status while using dselect
i upgraded the following 6 packages:
adduser apt apt-utils libfreetype6 manpages slang1a-utf8
during the installation io_rate peaked around 8,000-10,000 for each package with a drop between packages.
and then when it erased previously downloaded .deb files at the end, io_rate hit an all time high of 11,000
when it was all said & done i still had over 280,000 io_tokens, so i think i'm imagining things.
but i do understand much better how IO works. thanks a lot Adam!
Adam
mine says I refill at 512 and I have a 96
Is there a same constraint over cpu usage?
kill -STOP 1622
sleep 300
kill -CONT 1622
sleep 90
sh throttle
* 1622 is the pid of the process.
Throttle is the name of the script.</list>
The end result may not be any faster, but it prevents the server from bottoming out and it makes me feel better, psychologically. YMMV.
@ksmith99:
I've been having some trouble with a large import and when packing an overstuffed Zope database. Once io_tokens reaches negative numbers the system just crawls. To avoid hitting negative numbers I create a batch file that temporarily suspends the offending process, sleeps for a few minutes, continues process for a minute, repeat.
kill -STOP 1622 sleep 300 kill -CONT 1622 sleep 90 sh throttle
* 1622 is the pid of the process.
Throttle is the name of the script.</list>
The end result may not be any faster, but it prevents the server from bottoming out and it makes me feel better, psychologically. YMMV.
Won't that script run sh recursively indefinitely? So you'll get a new sh process every time through the loop? Why not just do:
#!/bin/sh
while true; do
kill -STOP $1
sleep 300
kill -CONT $1
sleep 90
done
Then you can run the script against a target pid, say like "throttle.sh 1234" …