Hacker Newsnew | past | comments | ask | show | jobs | submit | sserrano44's commentslogin

Load average measures how long is the queue of processes waiting for the CPU.

Most web applications aren't CPU intensive, rather they depend on many other services like the database, S3, ... If a web worker is waiting for another service it should release the CPU until the service responds.

So is entirely possible that all workers are waiting for other services, your app is not responding and the CPU is free.


> Load average measures how long is the queue of processes waiting for the CPU

I don't think that's quite right.

Load averages measure the size of queue of processes runnable and waiting for CPU or disk.

If you ever have a webserver/cache that has disks that have become the bottleneck, you can often get to a high load (lots of runnable processes, blocked on disk) but low CPU util (everything is blocked on disk, CPU relatively idle).

In my experience high UNIX load on busy systems is far more caused by disk IO utilisation rather than CPU utilisation.

E.g. if you run "du -s / &" 4 times, you can watch your UNIX load go to 4 (after 1 minute), but you will have idle CPU time. This will be more obvious if you have slow magnetic disks rather than a fast SSD.


> If a web worker is waiting for another service it should release the CPU until the service responds.

Emphasis on "should". With your average drivel (Wordpress e.g.) this doesn't happen and the load on the application server scales nicely with the response time of the database server. 10 requests waiting on a locked table for 2 seconds = load of 10.


Are you saying that the PHP mysql driver waits for the results with a busy loop? I have to say I find that hard to believe.


> I have to say I find that hard to believe.

¯\_(ツ)_/¯

Steps to reproduce: Set up one mysql server. Set up one PHP application server (nginx+PHP fpm in my case, shouldn't make a difference with mod_php) on a different machine. Configure Wordpress to use said mysql server. Lock the database in some way (say, mysqldump of a Wordpress installation with millions of records in wp_options), then hit the application server with regular traffic (or ab), watch as load reaches pm.max_children. On the application server, not the database server.


If a service waits for another service, then that other service often contributes to CPU load.

Not always, no...


Not when the other service is on another machine, like in the case I described.


Sorry, I was sloppy. I meant that it generates CPU load somewhere (or I/O load, for those OSes where those two are cleanly separated).

If you measure the CPU load on half the CPUs that are involved in serving a user, you're not really measuring anything. Ditto if you're outsourcing (parts of) the backend and not measuring the outsourced service level.


> Sorry, I was sloppy. I meant that it generates CPU load somewhere (or I/O load, for those OSes where those two are cleanly separated).

Not necessarily. In the scenario I outlined to icebraining, "load" is generated (on the app server) by simple busy waits due to lock congestion: Full table locks by mysqldump block the database server to clients, so the database server itself is seeing negligible load (it's only serving one client after all).

> If you measure the CPU load on half the CPUs that are involved in serving a user, you're not really measuring anything

I'd rather argue that the Unix/Linux CPU load metric is meaningless either way, except in a vague "something's wrong somewhere, probably" way.


IMO if there's enough busywaiting that it shows up on the CPU load, then there's so much busywaiting that that is a problem, because a CPU that's busy with such chores is not available for real work. The CPU load is not (as you say) very lucid, a bit like the question mark in the "unix car" joke, but in that particular case it's caused by a real problem: Too much busywaiting.


Load averages are complex and also quite different between different *nix operating systems. This old post on undeadly is pretty good.

http://undeadly.org/cgi?action=article&sid=20090715034920&mo...


No, they don't. What undefined0 wants is bitcoins for all the payments he gets including credit cards.



devsAr Inc. (http://devsar.com/) is looking to contract a part-time business developer base in San Francisco or the Bay Area.

At devsAr we build web and mobile applications for startups.

Job will basically include maintain relation with current clients, assist to events and seek for potential clients. Rates negotiable depending on previous experience/background.

Shoot me an email personally at sebastian@devsar.com


This is going to be the most energetic hackathon ever :-)

Curious to see if such a big prize is going to make the result worst or better, what you think?


It's funny how the big names are often very clueless. Google Startup Weekend picked a bill splitting app as the winner, of which there are hundreds of similar ones on the market already. Could be these people offering such huge prizes have never done a hackathon before and will similarly just award the same thing that shows up every time, or has been done a hundred times but that the judges are just ignorant about.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: