Want to subscribe to topics you're interested in?
Become a Member

Nginx PHP-FPM Nginx PageSpeed Reported memory usage on fresh install ?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Varun, Apr 9, 2018.

  1. Varun

    Varun Premium Member Premium Member

    36
    2
    8
    Apr 6, 2018
    India, Tamil Nadu, Chennai
    Ratings:
    +3
    Local Time:
    9:51 PM
    1.13.11
    I did a fresh install of CENTMIN MOD and
    created a vhost with wordpress. actually its a eCommerce site which uses WooCommerce Too.

    And also i installed HTOP & CINFO ( https://centminmod.com/addons.html#linfo )

    IN both i can see the RAM Usage
    ( - Physical 15.51 GiB 11.86 GiB 3.65 GiB 76% )

    Swap 1024 MiB 3.65 MiB 1020.35 MiB 0%
    Device Type Size Used /swapfile File 1024 MiB 3.67 MiB


    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit ?
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: Default Installed With 123.09beta01
    • PHP Version Installed: Default Installed With 123.09beta01
    • MariaDB MySQL Version Installed: Default Installed With 123.09beta01
    • When was last time updated Centmin Mod code base ? : Fresh Installed
    • Persistent Config: No
     
  2. eva2000

    eva2000 Administrator Staff Member

    33,704
    7,465
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,476
    Local Time:
    2:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    What's the question about ram usage ? Linux uses memory different from Windows in how it reports free and available memory and used memory. For an explanation see https://www.linuxatemyram.com/

    What is output for SSH commands
    Code (Text):
    free -m
    

    Code (Text):
    sar -r
    

    For posting code and output, you might want to use CODE tags for code How to use forum BBCODE code tags :)
     
  3. Varun

    Varun Premium Member Premium Member

    36
    2
    8
    Apr 6, 2018
    India, Tamil Nadu, Chennai
    Ratings:
    +3
    Local Time:
    9:51 PM
    1.13.11
    The output for free -m :
    Code (Text):
                  total        used        free      shared  buff/cache   available
    Mem:          15886        1155        1160         212       13570       14134
    Swap:          1023           4        1019
    



    The Output for sar -r

    Code (Text):
    12:00:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty
    12:05:01 AM    615964  15651484     96.21         0   3610176   8679112     50.12   1975924   2433068        48
    12:10:01 AM    516312  15751136     96.83         0   3610228   8768528     50.64   2048420   2433072        64
    12:15:01 AM    569892  15697556     96.50         0   3610284   8679148     50.12   1976680   2433060         4
    12:20:01 AM    551448  15716000     96.61         0   3610340   8679148     50.12   1976868   2432832        72
    12:25:01 AM    426456  15840992     97.38         0   3610460   8813980     50.90   2081656   2433060       116
    12:30:01 AM    502416  15765032     96.91         0   3610508   8691428     50.19   1979392   2433052        68
    12:35:01 AM    347672  15919776     97.86         0   3610620   8849072     51.10   2115544   2433048        44
    12:40:01 AM    493876  15773572     96.96         0   3585428   8830328     51.00   2024588   2481820        64
    12:45:01 AM    624088  15643360     96.16         0   3580912   8703724     50.26   1903676   2479536        72
    12:50:01 AM    537744  15729704     96.69         0   3580940   8793348     50.78   1975696   2479528        60
    12:55:01 AM    379648  15887800     97.67         0   3581024   8954096     51.71   2116352   2476744        56
    01:00:01 AM    511544  15755904     96.86         0   3581184   8793136     50.78   1974896   2476248        60
    01:05:01 AM    567032  15700416     96.51         0   3581088   8709836     50.30   1907204   2476184        12
    01:10:01 AM    540372  15727076     96.68         0   3589360   8711872     50.31   1904388   2484372        12
    01:15:01 AM    526468  15740980     96.76         0   3589436   8711916     50.31   1903912   2484372        56
    01:20:01 AM    604596  15662852     96.28         0   3573172   8711916     50.31   1894476   2476260        40
    01:25:01 AM    589908  15677540     96.37         0   3573264   8711916     50.31   1894700   2476264        64
    01:30:01 AM    567236  15700212     96.51         0   3573168   8711916     50.31   1895792   2475868        64
    01:35:01 AM    446932  15820516     97.25         0   3573256   8828348     50.98   1996540   2474796        76
    01:40:01 AM    527280  15740168     96.76         0   3573348   8711872     50.31   1896820   2474788        68
    01:45:01 AM    508920  15758528     96.87         0   3573436   8711916     50.31   1897336   2474700        12
    01:50:01 AM    488364  15779084     97.00         0   3573496   8711928     50.31   1897988   2474416         0
    01:55:01 AM    667412  15600036     95.90         0   3514116   8856876     51.15   1974380   2466780         4
    02:00:01 AM    673736  15593712     95.86         0   3514000   8834240     51.02   1950928   2466568         4
    02:05:01 AM    684900  15582548     95.79         0   3514056   8801636     50.83   1919468   2466544        64
    02:10:01 AM    455688  15811760     97.20         0   3514620   9019856     52.09   2132748   2465620        88
    02:15:01 AM    710804  15556644     95.63         0   3514680   8712020     50.31   1857208   2465004        72
    02:20:01 AM    397036  15870412     97.56         0   3514768   9038476     52.20   2141200   2464912        72
    02:25:01 AM    414376  15853072     97.45         0   3505832   9049096     52.26   2142004   2461020       824
    02:30:01 AM   1078456  15188992     93.37         0   3354664   9143092     52.80   2171728   2364116       276
    02:35:01 AM   1212180  15055268     92.55         0   3354724   8961876     51.75   2022136   2357060       136
    02:40:01 AM   1418068  14849380     91.28         0   3349924   8712060     50.31   1800804   2353196        84
    02:45:01 AM    944616  15322832     94.19         0   3353596   9207792     53.17   2249520   2351620       168
    02:50:01 AM   1205276  15062172     92.59         0   3354604   9094608     52.52   2009528   2311892        72
    02:55:01 AM   1339460  14927988     91.77         0   3357152   8920964     51.52   1853024   2313568        20
    03:00:01 AM   1167140  15100308     92.83         0   3359028   9082272     52.45   2004688   2315240        16
    03:05:01 AM   1197140  15070308     92.64         0   3361324   9041660     52.22   1957740   2314736        12
    03:10:01 AM   1154728  15112720     92.90         0   3362580   9059524     52.32   1984332   2315860         8
    03:15:01 AM    824988  15442460     94.93         0   3366856   9403268     54.30   2279596   2316508        12
    03:20:01 AM    643428  15624020     96.04         0   3351848   9642064     55.68   2502776   2315100       492
    03:25:01 AM    771412  15496036     95.26         0   3338352   9506396     54.90   2361460   2293432        32
    03:30:01 AM    984708  15282740     93.95         0   3338264   9221476     53.25   2127288   2292456        88
    03:35:01 AM    504644  15762804     96.90         0   3339044   9731792     56.20   2574252   2290904         0
    03:40:01 AM   1009016  15258432     93.80         0   3341568   9145948     52.82   2053812   2292344        36
    03:45:01 AM    806844  15460604     95.04         0   3333388   9329180     53.88   2214132   2289140       408
    03:50:01 AM    780608  15486840     95.20         0   3297640   9350656     54.00   2218624   2291808      5812
    03:55:01 AM   1050336  15217112     93.54         0   3302012   9030244     52.15   1959636   2266064        40
    04:00:01 AM    856436  15411012     94.74         0   3307136   9218536     53.24   2119388   2269396         0
    04:05:01 AM    757100  15510348     95.35         0   3314140   9305396     53.74   2198228   2274048         0
    04:10:01 AM    917056  15350392     94.36         0   3222784   9674608     55.87   2463384   2247820      1180
    04:15:02 AM   1566732  14700716     90.37         0   3227952   8920884     51.52   1796136   2249840        44
    04:20:01 AM   1469220  14798228     90.97         0   3229856   9004588     52.00   1869284   2251368        44
    04:25:01 AM   1468644  14798804     90.97         0   3230536   8998852     51.97   1866316   2250168        64
    04:30:01 AM   1256576  15010872     92.28         0   3232896   9230996     53.31   2058988   2248840        12
    04:35:01 AM   1090640  15176808     93.30         0   3235400   9367940     54.10   2212404   2250372        36
    04:40:01 AM   1390044  14877404     91.46         0   3206592   9046224     52.24   1921668   2221288        56
    04:45:01 AM   1186196  15081252     92.71         0   3209436   9242420     53.37   2096720   2223948         0
    04:50:01 AM   1174868  15092580     92.78         0   3214192   9232296     53.32   2081808   2227816       368
    04:55:01 AM   1076308  15191140     93.38         0   3219412   9259972     53.48   2147968   2232360         8
    05:00:01 AM   1333220  14934228     91.80         0   3222688   8997404     51.96   1872888   2234976        24
    05:05:01 AM    971296  15296152     94.03         0   3225264   9356976     54.04   2209088   2236604        64
    
    05:05:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty
    05:10:01 AM   1338280  14929168     91.77         0   3228348   8944716     51.66   1824852   2237876        44
    05:15:01 AM   1215672  15051776     92.53         0   3230232   9046668     52.24   1931992   2236712       308
    05:20:01 AM   1238928  15028520     92.38         0   3233308   8997404     51.96   1888880   2239564       428
    05:25:01 AM   1041140  15226308     93.60         0   3235424   9191760     53.08   2067212   2241088       392
    05:30:01 AM   1148836  15118612     92.94         0   3236988   9061812     52.33   1940288   2242432       388
    05:35:01 AM   1251656  15015792     92.31         0   3238800   8920960     51.52   1824172   2242768        68
    05:40:01 AM   1239416  15028032     92.38         0   3241616   8920964     51.52   1817952   2244712        84
    05:45:01 AM   1218008  15049440     92.51         0   3243808   8920964     51.52   1819008   2246456        12
    05:50:01 AM   1198952  15068496     92.63         0   3245312   8920912     51.52   1819396   2247660        16
    05:55:01 AM    922400  15345048     94.33         0   3248036   9206248     53.17   2079152   2248640       372
    06:00:01 AM    862308  15405140     94.70         0   3249872   9257344     53.46   2119848   2246608       484
    06:05:01 AM   1007752  15259696     93.81         0   3257292   9077472     52.42   1953648   2252640      1360
    06:10:01 AM   1014036  15253412     93.77         0   3233436   9215872     53.22   2067528   2244080       460
    06:15:01 AM   1253888  15013560     92.29         0   3170692   9070424     52.38   1917132   2195472       656
    06:20:01 AM   1216492  15050956     92.52         0   3176228   9091152     52.50   1938208   2197616        56
    06:25:01 AM   1211736  15055712     92.55         0   3180168   9060712     52.33   1910696   2200968       356
    06:30:01 AM   1300260  14967188     92.01         0   3144544   9082028     52.45   1926428   2184456        76
    06:35:01 AM   1365232  14902216     91.61         0   3148392   8998276     51.97   1837072   2187864         8
    06:40:01 AM    999508  15267940     93.86         0   3150668   9372640     54.13   2177240   2189944         4
    06:45:01 AM   1304896  14962552     91.98         0   3153272   9014552     52.06   1853864   2191964        48
    06:50:01 AM    926228  15341220     94.31         0   3157112   9410064     54.34   2206964   2195636       300
    Average:       906477  15360971     94.43         0   3371532   9024458     52.12   2018752   2332105       217
    
    
    


     
  4. eva2000

    eva2000 Administrator Staff Member

    33,704
    7,465
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,476
    Local Time:
    2:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    Are you on dedicated server or VPS ? If VPS is it OpenVZ or KVM/XEN based ?

    If on OpenVZ VPS then memory is reported differently in sar -r output as virtual memory (VSZ) is also reported as used memory while on non-OpenVZ VPS or dedicated, virtual memory is not reported as used memory. CentOS 7 sees to report correctly memory in free command on OpenVZ but CentOS 6 would report like sar output where VSZ memory is used but available. See Difference between VSZ vs RSS memory usage - LinuxConfig.org

    You can see breakdown of your memory usage percentage, VSZ and RSS (actual memory usage) per process using command
    Code (Text):
    ps aufxw
    

    use small sample of output for nginx related processes
    Code (Text):
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    
    root       897  0.0  0.7 645924 30376 ?        Ss   Apr08   0:00 nginx: master process /usr/local/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
    nginx      898  0.0  1.3 674596 53880 ?        S<   Apr08   0:06  \_ nginx: worker process
    nginx      900  0.0  1.4 674596 54372 ?        S<   Apr08   0:07  \_ nginx: worker process
    nginx      902  0.0  0.8 645924 31088 ?        S    Apr08   0:16  \_ nginx: cache manager process
    

    If you want to look at per process id memory usage stats use pidstat i.e. for nginx worker process pid = 900 run pidstat every 1 sec for 5 runs and sed is just to replace your main hostname with word hostname so mask your domain for posting on public places
    Code (Text):
    pidstat -durh -p 900 1 5 | sed -e "s|$(hostname)|hostname|g"
    

    example output for pid = 900 for nginx worker process showing %MEM used = 1.4% with RSS real memory usage at 54372 KB and virtual memory VSZ at 674596 KB
    Code (Text):
    pidstat -durh -p 900 1 5 | sed -e "s|$(hostname)|hostname|g"
    Linux 3.10.0-693.21.1.el7.x86_64 (hostname)     04/09/2018      _x86_64_        (2 CPU)
    
    #      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s  Command
     1523258123  1000       900    0.00    0.00    0.00    0.00     1      0.00      0.00  674596  54372   1.40      0.00      0.00      0.00  nginx
    
    #      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s  Command
     1523258124  1000       900    0.00    0.00    0.00    0.00     1      0.00      0.00  674596  54372   1.40      0.00      0.00      0.00  nginx
    
    #      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s  Command
     1523258125  1000       900    0.00    0.00    0.00    0.00     1      0.00      0.00  674596  54372   1.40      0.00      0.00      0.00  nginx
    
    #      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s  Command
     1523258126  1000       900    0.00    0.00    0.00    0.00     1      0.00      0.00  674596  54372   1.40      0.00      0.00      0.00  nginx
    
    #      Time   UID       PID    %usr %system  %guest    %CPU   CPU  minflt/s  majflt/s     VSZ    RSS   %MEM   kB_rd/s   kB_wr/s kB_ccwr/s  Command
     1523258127  1000       900    0.00    0.00    0.00    0.00     1      0.00      0.00  674596  54372   1.40      0.00      0.00      0.00  nginx
    


    So go by free output for memory usage if on CentOS 7. It oks good to me you have 14134MB of memory available.
     
  5. Varun

    Varun Premium Member Premium Member

    36
    2
    8
    Apr 6, 2018
    India, Tamil Nadu, Chennai
    Ratings:
    +3
    Local Time:
    9:51 PM
    1.13.11
    I bought a node @ digitalocean and it uses KVM Virtualization
    but i am not if i really have 14GB Free. because
    linfo APP Shows that its about 80% in use
    htop shows only 1.5GB is used.

    now i am totally confused !!

    HTOP Output : http://s.svarun.in/pc
    Linfo Output : http://s.svarun.in/pe


     
  6. eva2000

    eva2000 Administrator Staff Member

    33,704
    7,465
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,476
    Local Time:
    2:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    I'd just use free output to check and ps and pidstat as most apps or software may calculate used memory differently i.e. looks like they're reporting used as free output's used memory + buffer/cache which comes to around 93% of used memory - while technically buffer/cached memory is available for use (the free output available column). Free command is native to system so most accurate.
     
..