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

  • Resolved bradsalomons

    (@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 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Saumya Majumder

    (@isaumya)

    Hi,
    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.

    I found this thread, after posting an Issue report on Github.

    What you’ve written here seems to address the issue I have reported. However, I am wondering about which data from /proc/meminfo is most relevant. I see it reporting:

    `
    MemTotal: 2048112 kB
    MemFree: 325808 kB
    MemAvailable: 1363144 kB
    `
    Based on the memory usage reported by top/htop, and also by the monitor on my server, the MemAvailable appears to be the more accurate indication of RAM available. It’s the one that matches top/htop and the server RAM monitor. It shows that 684968 is in use, which is about 33%.

    This matches what TOP shows:
    `
    KiB Mem : 2048112 total, 310804 free, 385364 used, 1351944 buff/cache
    KiB Swap: 0 total, 0 free, 0 used. 1349148 avail Mem
    `
    and HTOP, and the RAM monitor (on Digital Ocean dashboard).

    Perhaps your plug-in needs to use the MemAvailable number for its calculation?

    [PS. I’ll post a copy of this to the Git issue]

    Plugin Author Saumya Majumder

    (@isaumya)

    @inspired888 I have replied you on github.

    Hi Saumya. Thanks for letting me know. The reply is not showing on Github. Have you submitted it yet?

    Plugin Author Saumya Majumder

    (@isaumya)

    @inspired888 Yes I have and I’ve also pushed a fix in the GitHub, please try it out and let me know if it fixes the issue and makes the data accurate.

    Plugin Author Saumya Majumder

    (@isaumya)

    Thanks, @inspired888 for reporting the problem and doing the research, the fix has been pushed publicly in v1.6.1

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Real Time RAM Usage’ is closed to new replies.