[NBLUG/talk] top output help

S. Saunders sms at sonic.net
Wed Apr 25 09:05:13 PDT 2007


On Tue, April 24, 2007 23:10, Walter Hansen wrote:

> The server runs multiple instances of a perl application that I wrote. I
> did manage to cut it's memory footprint by almost 10% today, but the
> bosses just added 100 instances. I cranked it up to see what it would do
> and things didn't creep, but stuff didn't seem all that happy ether. At
> the time of this top it was running 295 instances. I think each instance
> sucks up 5400 (is it k or bytes in top?) of footprint (RES); got that
> down from 5900. It's run on a 1U server at sonic and I've been told that
> we can't upgrade the memory.
>
> I've been thinking about going through the code and optimizing it for
> memory usage. This would probably be useful, but I don't think I could
> squeeze it down more than another 10 or 20%.

Could it be re-written as a monolithic, iterating app, rather than as
separate instances?  Even if the app were 10x the size, if the per-
iteration cost were small enough it'd be worth it, given that "the
bosses" are prone to "just add 100 instances."

You'd also avoid a fair bit of context-switching overhead &c.

Run it at an elevated priority, and it'd still get lots of cycles...

All "in theory" of course, and "maybe," since I don't knowing any
details of the applet or its function...


- Steve S.





More information about the talk mailing list