MRatWork Forum by Mustafa Ramadhan - [ASK] High RAM/Memory/CPU Usage

Sponsor:
Server and Web Integrator
Link:
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:

MRatWork Forum | Please login or register. | 2017-11-07, 17:26:49

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- [ASK] High RAM/Memory/CPU Usage

« previous next »

- Print

Pages: [1] 2 Go Down

### Author Topic: [ASK] High RAM/Memory/CPU Usage (Read 1262 times)

0 Members and 1 Guest are viewing this topic.

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### [ASK] High RAM/Memory/CPU Usage

« on: 2017-01-27, 15:30:42 »
begini pak, ada beberapa hal yang membuat saya penasaran tentang ram manajemen pada kloxomr ini. saya pertama menggunakan kvm vps ram 4GB yg terpakai sekitar 60%, karena cpu usage yg cukup tinggi maka saya menggunakan dedicated server ram 32GB dan Intel Xeon E3-1231 v3 @ 3.40GHz, 8 cores.
tapi anehnya penggunaan ram dedicated server juga tinggi mencapai 40%, padahal setingan FastCGI Children di set 50 dan KVM set 40. Penggunaan ram bind dns pd dedicated server 685.45 MB sedangkan di vps 385.10 MB. nginx worker process ketika di vps cumn jalan 4 ID, ketika pindah ke dedi jadi 8. Penggunaan ram kloxo panel di vps 507.58 MB di dedi 891.35 MB. Saya set PHP-fpm Type ondemand semua, dan menggunakan nginxonly, dan setingan lain disamakan semua.
nah kemudian dulu sudah agak lama sekitar 2 tahun yang lalu ketika menggunakan KVM ram 2GB dg user online 2000an tidak ada masalah dg cpu usage, padahal menggunakan nginxproxy. sekarang kok menggunakan nginxonly dan spesifikasi yg lebih besar tapi cpu usage sangat tinggi (selalu di atas 90%), padahal kalau dulu itu codingnya masih banyak bug dan harusnya banyak error log secara teori harusnya cpu usage lebih besar. setelah pindah ke dedi cpu usage jd 10%
NB: jumlah domain dan trafik juga sama, karena saya migrasi semua.
kenapa bisa begitu?
terimakasih
Code: [Select]

    sh /script/sysinfo
    A. Control Panel:
       - Kloxo-MR: 7.0.0.b-2017012502
       - Web: hiawatha-10.4.0-f.1.mr.el6.x86_64
       - PHP: php54s-5.4.45-1.ius.centos6 (fpm mode)
    B. Plateform:
       - OS: CentOS release 6.8 (Final) x86_64
       - Hostname: online.xxxxxxx
    C. Services:
       1. MySQL: MariaDB-server-10.0.29-1.el6.x86_64
       2. PHP:
          - Installed:
            - Branch: php54-cli-5.4.45-1.ius.centos6.x86_64
            - Multiple:
              * php54m-5.4.45-1.ius.centos6
              * php55m-5.5.38-1.ius.centos6
          - Used: php55m-fpm
          - Multiple: disable
       3. Web Used: nginx
         - Hiawatha: hiawatha-10.4.0-f.1.mr.el6.x86_64
         - Lighttpd: lighttpd-1.4.44-1.el6.x86_64
         - Nginx: nginx-1.11.9-1.el6.ngx.x86_64
         - Apache: httpd-2.2.31-1.mr.el6.x86_64
           - PHP Type: php-fpm_event
           - Secondary PHP: off
       4. WebCache: none
         - ATS: --uninstalled--
         - Squid: --uninstalled--
         - Varnish: --uninstalled--
       5. Dns: bind
         - Bind: bind-9.9.7-1.mr.el6.x86_64
         - DJBDns: --uninstalled--
         - NSD: --uninstalled--
         - PowerDNS: --uninstalled--
         - Yadifa: --uninstalled--
       6. Mail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
          - pop3/imap4: none
          - smtp: none
          - spam: --uninstalled--
       7. Stats: --Disabled--
    D. Memory:
                    total       used       free     shared    buffers     cached
       Mem:         31941      13184      18756          1        218        689
       -/+ buffers/cache:      12276      19664
       Swap:         1023          0       1023
    E. Disk Space:
       Filesystem      Size  Used Avail Use% Mounted on
       /dev/md1         20G  2.9G   16G  16% /

Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #1 on: 2017-01-27, 15:42:18 »
Satu kasus yaitu nginx worker. Instance dari nginx tergantung jumlah core dari cpu.
Secara normal semestinya mem utk buffers/cache used semestinya rendah tapi mem untuk mungkin buffers/cached mungkin tinggi. Pada kasus anda terjadi sebaliknya. Ini bisa jadi ada sesuatu pada /etc/sysctl.conf yang tidak umum.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #2 on: 2017-01-27, 15:44:25 »
Ini contoh kondisi yang saya rasa 'normal':
Code: [Select]

    > free -m
                 total       used       free     shared    buffers     cached
    Mem:         15906      13816       2089         65        591      10021
    -/+ buffers/cache:       3203      12702
    Swap:         4095         24       4071

Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #3 on: 2017-01-27, 15:46:06 »
Coba infokan 'sh /script/mem-usage'.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #4 on: 2017-01-27, 19:04:06 »
ini hasil sh /script/mem-usage
Code: [Select]

    *************************************************************************

                 total       used       free     shared    buffers     cached
    Mem:         31941      14323      17617          2        219        719
    -/+ buffers/cache:      13385      18555
    Swap:         1023          0       1023

    *************************************************************************

    User     Count     Swap      USS      PSS      RSS
    dbus         1        0   548.0K   561.0K   960.0K
    lxlabs       1        0     2.5M     2.5M     3.2M
    haldaemon     2        0     3.3M     3.5M     5.4M
    named        1        0    22.9M    23.0M    24.0M
    root        34        0    73.7M    78.9M   118.1M
    apache      14        0    98.8M   108.4M   213.0M
    mysql        1        0   121.4M   121.5M   122.8M
    myUser      39        0   134.5M   144.9M   682.1M
    ---------------------------------------------------
                93        0   457.7M   483.3M     1.1G

terus kalau untuk cpu usage bagaimana pak?
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #5 on: 2017-01-28, 03:20:19 »
Coba periksa 'mail quue' dan 'mail log' pada 'log manager'. Jangan-jangan ada website yang kena hack sehingga kirim banyak mail (bisa berakibat cpu yang tinggi).
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #6 on: 2017-01-28, 11:47:43 »
lognya seperti ini semua, sebagai contoh tgl 27 ada 437 line seperti di bawah, tapi itu qmail sudah saya nonaktifkan, dan saya lihat tidak ada code/file yg mencurigakan...
Code: [Select]

    Jan 28 13:00:01 online root: sendmail: CALLER="CROND" PWD="/root" BAN="no"
    Jan 28 13:04:35 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundGNQTVQ" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:09:36 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundbPYJRZ" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:10:01 online root: sendmail: CALLER="CROND" PWD="/root" BAN="no"
    Jan 28 13:14:36 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundB91yCh" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:19:36 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/background9qDbRw" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:20:01 online root: sendmail: CALLER="CROND" PWD="/root" BAN="no"
    Jan 28 13:24:37 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundAsEVjG" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:29:37 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundXDwQDW" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:30:01 online root: sendmail: CALLER="CROND" PWD="/root" BAN="no"
    Jan 28 13:34:37 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/background9Et7ad" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"
    Jan 28 13:39:38 online logger: sendmail: CALLER="/opt/php54s/usr/bin/php -c /opt/php54s/custom/php.ini ../bin/common/background.php /tmp/backgroundr3dLHx" PWD="/usr/local/lxlabs/kloxo/httpdocs" BAN="no"

terus itu kelanjutan penggunaan ram bagaimna? sekarang sudah meningkat jd 58% penggunaan ram...
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #7 on: 2017-01-28, 14:08:44 »
Coba infokan 'sysctl -p; ulimit -a'.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #8 on: 2017-01-28, 14:27:14 »
Code: [Select]

    net.ipv4.ip_forward = 0
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    net.ipv4.tcp_syncookies = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.shmmax = 68719476736
    kernel.shmall = 4294967296
    fs.aio-max-nr = 1048576
    fs.file-max = 1048576
    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_max_syn_backlog = 2048
    net.ipv4.tcp_synack_retries = 3
    core file size          (blocks, -c) 0
    data seg size           (kbytes, -d) unlimited
    scheduling priority             (-e) 0
    file size               (blocks, -f) unlimited
    pending signals                 (-i) 127653
    max locked memory       (kbytes, -l) 64
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) 20480
    pipe size            (512 bytes, -p) 8
    POSIX message queues     (bytes, -q) 819200
    real-time priority              (-r) 0
    stack size              (kbytes, -s) 10240
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 127653
    virtual memory          (kbytes, -v) unlimited
    file locks                      (-x) unlimited

Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #9 on: 2017-01-28, 14:42:22 »
Coba lihat log untuk nginx (juga apache jika pakai nginx-proxy) serta file /var/lib/mysql/*.err (untuk mysql).
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #10 on: 2017-01-28, 15:13:15 »
saya pakai nginx only pak, error/acces log nginx saya disable pak, tp sebelum saya disable ini sisa error lognya kebanyakan seperti ini
Code: [Select]

    2017/01/26 05:12:40 [crit] 2545#2545: cache file "/var/cache/nginx-fastcgi/f/82/4581598a73bf8a665db2e0e943c6f82f" is too small
    2017/01/26 05:12:40 [crit] 2545#2545: cache file "/var/cache/nginx-fastcgi/f/82/e80aed4d5e67c72e402d2a769843782f" is too small
    2017/01/26 05:12:40 [crit] 2545#2545: cache file "/var/cache/nginx-fastcgi/f/82/e9060971f4ddd508df0b3b988360a82f" is too small
    2017/01/26 05:12:40 [crit] 2545#2545: cache file "/var/cache/nginx-fastcgi/f/42/c0f9bbdc1587d881a81d12004935e42f" is too small
    2017/01/26 05:12:40 [crit] 2545#2545: cache file "/var/cache/nginx-fastcgi/f/b2/5192457d54efbd436b57440af7562b2f" is too small

dan web saya tidak ada yang makek db sql, pure php...
ini file .err http://pastebin.com/raw/5zh3iDpP
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #11 on: 2017-01-28, 16:37:24 »
Bisa jadi adanya nginx cache yang bikin masalah.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #12 on: 2017-01-28, 16:57:21 »
terus solusinya bagaimana pak? sudah saya cleanup terus reboot ttp saja gk ngefek, sekarang penggunaan ram jd 62%
Logged

#### GentZu

- Senior Member
- Posts: 323
- Karma: +0/-0
- Gender:
- yare yare...

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #13 on: 2017-01-29, 08:00:23 »
sekarang malah jadi 75% mem usagenya...
Logged

#### MRatWork

- Administrator
- The Elite
- Posts: 15,381
- Karma: +112/-9
- Gender:

##### Re: [ASK] High RAM/Memory/CPU Usage

« Reply #14 on: 2017-01-29, 08:31:47 »
Saya rasa itu terkait dengan error pada webserver atau php. Coba anda pelajari log untuk itu.
Misalnya ada proses write file directory tertentu yang directorynya tidak ada (atau permissions/ownership) akan memiliki efek yang sama.
Logged
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

- Print

Pages: [1] 2 Go Up
« previous next »

- MRatWork Forum by Mustafa Ramadhan »
- Language Specific Discussions »
- Indonesia Users »
- [ASK] High RAM/Memory/CPU Usage

MRatWork Affiliates: BIGRAF(R) Inc. House of LMAR EFARgrafix

- Design By SMFSimple.com
- SMF 2.0.14 | SMF © 2017, Simple Machines

Page created in 0.051 seconds with 18 queries.

Mirror created by MasterkinG32.CoM