# 2012-10-17 awk

Last edit

Summary: Added: Now we just need to figure out who this user 1231 is. Who needs 233 php-cgi processes running?

Changed:

< Thanks, ##awk##. You might be awkward to use, but you get the job done.

to

> Thanks, ##awk##. You might be awkward to use, but you get the job done. Now we just need to figure out who this user 1231 is. Who needs 233 php-cgi processes running?

Sometimes it’s hard to remember how cool awk used to be – I haven’t used awk ever since I switched to Perl about 15 years ago.

Today I wondered who had so many sleeping php-cgi processes on the server hosting Campaign Wiki:

ps aux | awk '/php-cgi$/ { user[$1]++} END { for (u in user) { print u, user[u] }}'
1231 233
greywulf 1

Thanks, awk. You might be awkward to use, but you get the job done. Now we just need to figure out who this user 1231 is. Who needs 233 php-cgi processes running?

Tags:

Last edit

Changed:

< -- AlexSchroeder 2012-10-18 07:00 UTC

to

> -- [[AlexSchroeder]] 2012-10-18 07:00 UTC

Wish I could figure out what’s causing these. Most annoying :\

greywulf 2012-10-17 21:25 UTC

Not your fault! When I looked you had one php-cgi process running. That makes total sense. It was this other user id that had more than 200 sleeping processes running that I cared about. (Added this clarification to the blog post, too.)

AlexSchroeder 2012-10-18 07:00 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.