Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Web servers get hardware upgrade (PM hw)

by tim (Initiate)
on Feb 02, 2005 at 17:21 UTC ( [id://427343]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Web servers get hardware upgrade (PM hw)
in thread Web servers get hardware upgrade

I patched and recompiled Term::ReadKey so that it no longer was a CPU hog on FreeBSD so that we could use 'mytop' more often to monitor the DB. Then I reworked it and renamed it as sqltop and taught it how to run as a daemon, logging long-running queries and even killing ones that ran *too* long.

Hi, tye -- Unfortunately we couldn't make head or tail of your chatbox tip, "I just disabled the "compatability test", tim (FreeBSD is certainly compatible even though it fails that test)".

We're running 5.005_03 built for i386-freebsd on FreeBSD 4.9, and mytop-1.4 from freebsd ports. We tried ReadKey-2.21 and ReadKey-2.30, but runing mytop uses loads of system cpu:

PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND 12587 diamondd 65 10 5660K 4608K CPU0 0 0:13 96.87% + 46.34% perl CPU states: 0.0% user, 3.5% nice, 46.5% system, 0.6% in +terrupt, 49.4% idle ktrace just shows 12587 perl CALL read(0,0x814e000,0x1000) 12587 perl RET read -1 errno 35 Resource temporarily unavailabl +e 12587 perl CALL gettimeofday(0xbfbff9d0,0) 12587 perl RET gettimeofday 0 12587 perl CALL read(0,0x814e000,0x1000) 12587 perl RET read -1 errno 35 Resource temporarily unavailable

Google found this post, but hasn't given us any clues to the patch. If you'd be willing to share it, and allow us (on your behalf, of course) to add it to a patch submitted to update /usr/ports/devel/p5-Term-ReadKey from 2.21, we'd really appreciate it.

I've you'd like to contact me via email I can be reached at tim.hunter atsign eircom dot net. Thanks!

Replies are listed 'Best First'.
Re^5: Web servers get hardware upgrade (ReadKey patch)
by tye (Sage) on Feb 02, 2005 at 17:28 UTC

    Grab Term::ReadKey, unpack it and apply the following patch to ReadKey.xs:

    --- TermReadKey-2.18/ReadKey.xs Sun Feb 10 08:13:35 2002 +++ TermReadKey-2.18tye/ReadKey.xs Tue Mar 19 12:12:36 2002 @@ -1418,14 +1418,14 @@ #endif /* This is for the best, I'm afraid. */ -#if !defined(FCOUNT) +/*#if !defined(FCOUNT) # ifdef Have_select # undef Have_select # endif # ifdef Have_poll # undef Have_poll # endif -#endif +#endif*/

    Then build the module and install as usual.

    - tye        

      Works a treat on 4.9, thanks very much!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427343]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found