Support » Plugin: WP Server Stats » Real Time RAM Usage

  • Resolved bradsalomons


    Mostly a comment, but partially a question.

    First of all, thanks for this plugin. It’s very useful. I’m running a home server on a raspberry pi and it’s one of the few tools I have (short of logging into the server itself and digging through logs) for getting a sense of how the server is running.

    I noticed you significantly changed the calculation for real time RAM use. Last week it was tracking about 5-10% RAM and now after your update it’s floating at 90-95%. My heart stopped for a few beats when I saw that, but I did some digging in those logs. I compared the dashboard number with my server performance in the built-in tools (ie. top) and noticed that your new calculation seems to be including not just active memory use but the cache/buffer state as well (which is always using a huge chunk of whatever free memory is hanging around.) Is cache/buffer something that you could exclude in a future calculation? I’m not familiar enough with PHP to know if that is even possible.

    Like I said, mostly just a comment. Thanks again for your work!

Viewing 1 replies (of 1 total)
  • Plugin Author Saumya Majumder


    you have asked a brilliant question. As you are more familiar with the server log checking, you would understand this. First of all, you have to understand that when writing code for any plugin, I have to use some data which can be available on all Linux server. I know there are a lot of tools to check these data but the thing is most of them needs to be separately installed and also as the server OS can be any Linux based distros, I cannot simply rely on a simple command. So, I use the data from /proc/meminfo which can be found in all Linux based server.
    Now, this file does not actually show the amount of RAM being used, but it does show the total RAM in the system as well as the free RAM. Now earlier I had a major calculation error for calculating the ram usage percentage, but unfortunately, no one reported it except @pross. After he reported it I looked into the math and it seems the way it was calculating the percentage was: (free ram/total ram)*100, which is completely wrong.
    So, now what the plugin does is, it subtracts the free ram from the total ram value to get the used ram value data. Then it uses (used ram/total ram)*100 to calculate the actual ram usage. It also now shows the actual free ram in your system, just to give you a better perspective.
    I hope this clarifies all your queries, let me know if you have any other questions and thanks again to pross from reporting the issue, without his report, this would have gone completely unnoticed.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.