2012-10-17 awk

Difference between revision 2 and current revision

Summary: \[\[Campaign Wiki\]\] → [https://campaignwiki.org/ Campaign Wiki]

No diff available.

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: RSS

Show Google +1


Difference between revision 4 and current revision

Summary: \[\[gravatar:.*\]\]\n? →


< [[gravatar:http://greywulf.net greywulf:90ef098c30ca2f755f28cdc41b60e543]]


< [[gravatar: AlexSchroeder:e33b88db6bc04e1c93db25c702baea28]]

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.

To save this page you must answer this question:

Please say HELLO.