Author Topic: memory and cpu use over time  (Read 2091 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
memory and cpu use over time
« on: October 20, 2013, 08:21:52 AM »
A general caution that might be worth trying to test more rigerously....

I noticed this morning that my idle MUD was using up 30% of my CPU and about 120M of RAM.  The RAM is irrelevant (I have 16G), but the CPU was worrying.  This is after about a week's worth of uptime, and no real changes on my part.  This was FluffOS 3.07, latest from the git repository.

For comparison, I've reloaded FluffOS 2.27 and restarted the MUD.  At a fresh boot, it is using 40M of RAM and about 1% of the CPU, local_options being as similar as I could make them.

We'll see if this also grows after a week.

My experience has been that the memory use may grow slowly over time, but I've never had the CPU start being consumed like that, unless there was legitimate activity going on.

I'll keep you posted, but if you have any way to stress test things and leave it running somewhere for a long time, it might be worth doing.

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: memory and cpu use over time
« Reply #1 on: October 21, 2013, 07:32:43 PM »
When I run my mass object loader on our domains directory, it spikes the memory usage. (Obviously.)

Then I do "eval objects()->clean_up(0);" (several runs since there are more objects than the max array size), and eventually pare it down to a constant number of objects that are never supposed to unload.

At this point, the memory usage is quite a bit higher than at boot. Still to be expected, since all those additional no-unload objects are loaded.

Then I do the mass object load again, and then several more runs of clean_up()s, until I'm pared down to no-unload objects (same or similar number to before). But after this second round, my memory usage is significantly higher than after the first round.

Continuously doing these cycles of load/unload causes memory usage to climb, while the number of no-unload objects remains flat.

I'm planning to do more investigation: I haven't been able to run any tests to see what happens in the 2.x series, and I also haven't had a chance to look more closely at the lib code to see if there may be something in there that may be the culprit. I'll post results when I can find some free time.

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Re: memory and cpu use over time
« Reply #2 on: October 22, 2013, 12:14:01 PM »
After a few days, the 2.27.1 driver appears to be settled around 110M of RAM and between 1% and 4% CPU, which is more what I've come to expect from FluffOS.

So, the question is... was the 3.0 series CPU usage an anomoly, or an artifact of one of the changes in the event or socket system?  I know I saw something in the recent changelogs about that.

By comparison, on the same machine, I have a minecraft server which is currently idle of players, but continues to generate dynmap data and whatever world updates happen when nobody is logged in, and that is taking up 3% to 6% of the CPU, but of course a LOT more RAM. :)

Offline FallenTree

  • BFF
  • ***
  • Posts: 483
    • View Profile
Re: memory and cpu use over time
« Reply #3 on: October 23, 2013, 09:56:59 PM »
I was tweaking around the heartbeat etc, which may caused this artificially high cpu.  can you do git pull again and see if current trunk is better?