Wajarkah memory usagenya..??


Status
Not open for further replies.
@ cpserv.
Itu 2 server beda node beda dc beda provider :D yang B 99% bulan depan akan saya tinggalkan karena ngeri tiap hari dapet warning lfd puluhan login attempts failed from China...

my.cnf : max_connections = 350
Pernah saya coba set ke 100-400 tapi kaya gak ada efeknya mas.. Asumsi saya awalnya melihatnya ke
[OK] Maximum possible memory usage: 1.6G (78% of installed RAM)

@ vishualhost.
1. Easy apache saya pakai yang standard(yang warna orange) dan sedikit tambahan modul lain yang sudah saya pilih seminim mungkin(mcrypt, zip, curl, suhosin, mod_sec, mod bandwith dll yang menurut saya sangat basic sekali) sedangkan yang dari 3rd party saya cuma menambahkan mod_antiloris.

2. Iya mas info yang saya ketahui memang nginx baru terasa di server yang lalu lintasnya sudah padat, tapi Saya baru pasang nginx ini sekitar 3 mingguan dan sebelum ada nginx ram server malah kadang pernah tembus ke angka 850MB, baru setelah pakai nginx ini ram cuma mentok di 700MB (stabilnya di 600 an).

ps -o rss -C httpd | tail -n +2 | (sed 's/^/x+=/'; echo x) | bc
-bash: bc: command not found
Saya sudah mencoba mencari cari kira2 yang makan ram terlalu gedenya ini dimana dengan stop httpd dan mysql, kalau kedua service itu saya matikan cuma ada penurunan ram sekitar 150MB jadi asumsi saya kayaknya RAM usage ini lebih banyak terpakai oleh service2 yang lain, tapi bingung juga kira2 service2 tersebut yang mana dan apa bisa lebih dicompress lagi gitu...
 
btw mas xphone sudah dicoba uninstall nginxnya dan memakai single apache apakah memory usagenya sama kah ?

dan bisa dipastekan hasil cmd berikut ga outputnya , cmd ini biasa saya pakai buat cek top 10 cpu dan mem usage diserver

ps -eo user,pcpu,pmem | tail -n +2 | awk '{num[$1]++; cpu[$1] += $2; mem[$1] += $3} END{printf("NPROC\tUSER\tCPU\tMEM\n"); for (user in cpu) printf("%d\t%s\t%.2f\t%.2f\n",num[user], user, cpu[user], mem[user]) }'
 
Tadi siang saya sudah coba uninstall nginxnya mas hasilnya seperti ini

Pakai nginx==> ram 580MB-700MB, rata2 sekitar 625MB mentok paling tinggi 680MB
Tanpa nginx==> 540MB-795MB, rata2 sekitar 590MB

Top 10 cpu/memori:

NPROC USER CPU MEM
4 dovecot 0.00 0.00
2 xxx.com 3.50 3.50
3 named 0.00 0.00
4 xxxxxx.com 13.80 6.40
4 nobody 11.30 6.10
1 mailnull 0.00 0.00
1 mysql 1.20 3.10
30 root 0.00 4.50
----------------------------------------
NPROC USER CPU MEM
4 dovecot 0.00 0.00
1 dxxxxxg.com 3.40 2.10
3 named 0.00 0.00
5 nobody 10.60 7.60
1 mailnull 0.00 0.00
1 mysql 1.20 3.10
30 root 0.00 4.50
------------------------------
NPROC USER CPU MEM
4 dovecot 0.00 0.00
1 dxxxxng.com 2.90 2.10
3 named 0.00 0.00
5 nobody 9.40 7.60
1 mailnull 0.00 0.00
1 mysql 1.20 3.10
30 root 0.00 4.50
------------------------
NPROC USER CPU MEM
4 dovecot 0.00 0.00
3 named 0.00 0.00
5 nobody 9.70 7.80
2 mailnull 0.20 0.10
1 mysql 1.20 3.10
40 root 0.80 4.10
1 indoxxxx.com 2.30 1.90
-------------------------
Sekalian mas... tiap hari ada puluhan email lfd seperti ini. apa ini ada pengaruhnya ya...

Code:
Time:     Sat May 19 22:31:24 2012 +0700
IP:       [COLOR="#FF0000"]141.0.10.5 (US/United States/s33-07.opera-mini.net)[/COLOR] <<<operamini dan IP 141.0.xxx
Failures: 5 (mod_security)
Interval: [COLOR="#FF0000"]900 seconds[/COLOR] <<defaultnya 300 saya naikkan jadi 900 tetep sama
Blocked:  Permanent Block

Log entries:

[Sat May 19 22:30:03 2012] [error] [client 141.0.10.5] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:\\\\b(?:(?:n(?:et(?:\\\\b\\\\W+?\\\\blocalgroup|\\\\.exe)|(?:map|c)\\\\.exe)|t(?:racer(?:oute|t)|elnet\\\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\\\.exe|echo\\\\b\\\\W*?\\\\by+)\\\\b|c(?:md(?:(?:32)?\\\\.exe\\\\b|\\\\b\\\\W*?\\\\/c)|d(?:\\\\b\\\\W*?[\\\\\\\\/]|\\\\W*?\\\\.\\\\.)|hmod.{0,40}? ..." at REQUEST_HEADERS:User-Agent. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "160"] [id "959006"] [msg "System Command Injection"] [data "; id"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [hostname "domain-klien.com"] [uri "/"] [unique_id "T7e8e2yuN@4AAF36cdAAAAAE"]
[Sat May 19 22:30:03 2012] [error] [client 141.0.10.5] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:\\\\b(?:(?:n(?:et(?:\\\\b\\\\W+?\\\\blocalgroup|\\\\.exe)|(?:map|c)\\\\.exe)|t(?:racer(?:oute|t)|elnet\\\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\\\.exe|echo\\\\b\\\\W*?\\\\by+)\\\\b|c(?:md(?:(?:32)?\\\\.exe\\\\b|\\\\b\\\\W*?\\\\/c)|d(?:\\\\b\\\\W*?[\\\\\\\\/]|\\\\W*?\\\\.\\\\.)|hmod.{0,40}? ..." at REQUEST_HEADERS:User-Agent. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "160"] [id "959006"] [msg "System Command Injection"] [data "; id"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [hostname "domain-klien.com"] [uri "/favicon.ico"] [unique_id "T7e8e2yuN@4AAF0nLiUAAAAF"]
[Sat May 19 22:30:22 2012] [error] [client 141.0.10.5] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:\\\\b(?:(?:n(?:et(?:\\\\b\\\\W+?\\\\blocalgroup|\\\\.exe)|(?:map|c)\\\\.exe)|t(?:racer(?:oute|t)|elnet\\\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\\\.exe|echo\\\\b\\\\W*?\\\\by+)\\\\b|c(?:md(?:(?:32)?\\\\.exe\\\\b|\\\\b\\\\W*?\\\\/c)|d(?:\\\\b\\\\W*?[\\\\\\\\/]|\\\\W*?\\\\.\\\\.)|hmod.{0,40}? ..." at REQUEST_HEADERS:User-Agent. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "160"] [id "959006"] [msg "System Command Injection"] [data "; id"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [hostname "domain-klien.com"] [uri "/pass.php"] [unique_id "T7e8jmyuN@4AAF36cdIAAAAE"]
[Sat May 19 22:31:23 2012] [error] [client 141.0.10.5] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:\\\\b(?:(?:n(?:et(?:\\\\b\\\\W+?\\\\blocalgroup|\\\\.exe)|(?:map|c)\\\\.exe)|t(?:racer(?:oute|t)|elnet\\\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\\\.exe|echo\\\\b\\\\W*?\\\\by+)\\\\b|c(?:md(?:(?:32)?\\\\.exe\\\\b|\\\\b\\\\W*?\\\\/c)|d(?:\\\\b\\\\W*?[\\\\\\\\/]|\\\\W*?\\\\.\\\\.)|hmod.{0,40}? ..." at REQUEST_HEADERS:User-Agent. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "160"] [id "959006"] [msg "System Command Injection"] [data "; id"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [hostname "domain-klien.com"] [uri "/"] [unique_id "T7e8y2yuN@4AAF36ceIAAAAE"]
[Sat May 19 22:31:23 2012] [error] [client 141.0.10.5] ModSecurity: Access denied with code 501 (phase 2). Pattern match "(?:\\\\b(?:(?:n(?:et(?:\\\\b\\\\W+?\\\\blocalgroup|\\\\.exe)|(?:map|c)\\\\.exe)|t(?:racer(?:oute|t)|elnet\\\\.exe|clsh8?|ftp)|(?:w(?:guest|sh)|rcmd|ftp)\\\\.exe|echo\\\\b\\\\W*?\\\\by+)\\\\b|c(?:md(?:(?:32)?\\\\.exe\\\\b|\\\\b\\\\W*?\\\\/c)|d(?:\\\\b\\\\W*?[\\\\\\\\/]|\\\\W*?\\\\.\\\\.)|hmod.{0,40}? ..." at REQUEST_HEADERS:User-Agent. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "160"] [id "959006"] [msg "System Command Injection"] [data "; id"] [severity "CRITICAL"] [tag "WEB_ATTACK/COMMAND_INJECTION"] [hostname "domain-klien.com"] [uri "/favicon.ico"] [unique_id "T7e8y2yuN@4AAF0nLjUAAAAF"]
 
ini klo boleh tahu memory vpsnya brp mas ya , dan untuk account2 di vps apa ada yg banyak subdomainnya ?
klo untuk email lfd ga begitu pengaruh sepertinya ya mas.


keknya sih problem nya antara klo ga dr apachenya atau dr salah satu usernya .

ini yg paling besar keknya ya

4 xxxxxx.com 13.80 6.40

setahu aku antara process <nobody -- > httpd > dan <user --> php ( seperti pada xxxxxx.com )>
itu memory usage pasti akan lebih besar nobody -- > httpd process dibanding process php user ( ini klo normal usage memory yach bukan cpu ) karena dia counting track total all usage dr tree process .

ini sample yg saya coba cek di server saya :

NPROC USER CPU MEM
1 varnish 0.40 2.70
7 benvxx 0.20 0.30
1 tonyhxx 0.10 0.10
4 dovecot 0.00 0.00
1 kokoxxx 0.00 0.00
1 named 0.00 0.30
9 nobody 8.40 33.30
1 mailnull 0.00 0.00
2 sumberxx 0.00 0.00
1 mysql 3.90 7.40
36 root 0.30 5.80

klo diperhatikan process memory nobody -> httpd pasti lebih besar dr php process user .
klo yg saya lihat diatas paling besar process nobody -> httpd dr apache masih kalah besar dari memory usage yg ini

4 xxxxxx.com 13.80 6.40

jadi mungkin ya cuma nebak2 aja :D , klo ga dr apache config dsb atau bisa juga dari 1 user ini atau bisa juga ada user yg subdomainnya banyak / addon / parknya sehingga buat process memory httpd jd besar .

coba sekalian juga di outputkan cmd berikut :

command ps wwo pid,user,group,vsize:8,size:8,sz:6,rss:6,pmem:7,pcpu:7,time:7,wchan,sched=,stat,flags,comm,args k -vsz -A|sed -u '/^ *PID/d;10q'
 
Spek vps sudah saya post di page 1 mas..RAM 2GB burst 2GB

Code:
# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      :           Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
stepping        : 7
cpu MHz         : 3392.515
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6785.03
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: [8]

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      :           Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
stepping        : 7
cpu MHz         : 3392.515
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 1
cpu cores       : 4
apicid          : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6784.51
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: [8]

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      :           Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
stepping        : 7
cpu MHz         : 3392.515
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 2
cpu cores       : 4
apicid          : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6784.62
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: [8]

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 42
model name      :           Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
stepping        : 7
cpu MHz         : 3392.515
cache size      : 8192 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
apicid          : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx rdtscp lm constant_tsc ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6784.54
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: [8]


Memang ada 2 domain yang trafiknya lumayan mas. domain A uv sekitar 2000/hari dan domainB uv sekitar 5000/hari. saya sudah coba suspend kedua domain tersebut untuk memastikannya tapi selama 5 jam saya pantau kok sepertinya RAM cuma turun sekitar 30MB saja. bahkan sempat saya reboot juga awalnya ram memang turun di 350-400an tapi pelan2 naik teruusss sampai angka mendekati 600MB. Nah dari situlah awalnya saya mencoba pasang nginx.

Untuk addon domain terakhir cek kalau gak salah cuma 4 domain dan 2 park domain,sedang subdomain sepertinya juga gak terlalu banyak masing2 domain tidak lebih dari 5 subdomain dan sepertinya subdomain tersebut rata2 cuma sebagai testing2 website saja (tidak live/belum jadi web yang go publik)

command ps wwo pid,user,group,vsize:8,size:8,sz:6,rss:6,pmem:7,pc pu:7,time:7,wchan,sched=,stat,flags,comm,args k -vsz -A|sed -u '/^ *PID/d;10q'
ERROR: Process ID list syntax error.
 
klo mysql confignya di standarin ke standar dr cpanel apa masih sama juga kah mas ?
 
Langsung testing mas...
Code:
[mysqld]
set-variable = max_connections=500
log-slow-queries
safe-show-database
Langsung ram naik ke 625-760MB.
Balikin lagi ke
Code:
[mysqld]
max_connections = 350
key_buffer = 16M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_open_cache = 2048
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_size = 16M
query_cache_type = 1
query_cache_limit = 1M
max_heap_table_size = 16M
tmp_table_size = 16M
local-infile=0
slow-query-log <<sekarang saya coba ganti [COLOR="#000080"]log-slow-queries[/COLOR]
skip-innodb
 
[mysqld_safe]
open_files_limit = 8192
 
[mysqldump]
quick
max_allowed_packet = 16M
 
[myisamchk]
key_buffer = 32M
sort_buffer = 32M
read_buffer = 16M
write_buffer = 16M
Code:
Start Servers=1 
Minimum Spare Servers=1 
Maximum Spare Servers=5
Server Limit=150
Max Clients=150
Max Requests Per Child=10000
Keep-Alive=Off
Keep-Alive Timeout=3
Max Keep-Alive Requests=100
Timeout=100
Hanya pakai single apache RAM naik turun 540-650MB
Code:
[~]# htop
1  :  0.7% sy:  0.0% ni:  0.0% hi:  0.0% si:  0.Tasks: 58 total, 1 running
2  :  0.0% sy:  0.7% ni:  0.0% hi:  0.0% si:  0.Load average: 0.20 0.20 0.13
3  :  0.0% sy:  0.0% ni:  0.0% hi:  0.0% si:  0.Uptime: 17 days, 07:50:10
4  :  0.0% sy:  0.0% ni:  0.0% hi:  0.0% si:  0.0% wa:  0.0%
Mem[|||||||||||||                   587/2048MB]
Swp[                                     0/0MB]
  PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
28479 bixxxx  15   0 51640 28148 12440 S  0.0  1.3  0:00.39 /usr/local/apache/bin/httpd -k sta
28486 dowxxx  15   0 62440 33748  6912 S  0.0  1.6  0:00.68 /usr/local/apache/bin/httpd -k sta
28410 bixxxx  15   0 51644 28976 12976 S  0.0  1.4  0:00.88 /usr/local/apache/bin/httpd -k sta
27738 mysql     17   0 85092 52560  4508 S  0.0  2.5  0:01.75 /usr/sbin/mysqld --basedir=/ --dat
24006 root      15   0  2472  1140   900 R  0.0  0.1  0:07.44 htop
27741 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:02.95 /usr/sbin/mysqld --basedir=/ --dat
28483 nobody    15   0 49816 17660  3764 S  0.0  0.8  0:00.09 /usr/local/apache/bin/httpd -k sta
28411 indxxxx  15   0 57960 26208  4028 S  0.0  1.2  0:00.29 /usr/local/apache/bin/httpd -k sta
28350 cilegxxxx  15   0 61568 41692 15748 S  0.0  2.0  0:07.50 /usr/local/apache/bin/httpd -k sta
26531 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:00.89 /usr/sbin/mysqld --basedir=/ --dat
26535 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:01.70 /usr/sbin/mysqld --basedir=/ --dat
28129 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:01.16 /usr/sbin/mysqld --basedir=/ --dat
28204 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:00.66 /usr/sbin/mysqld --basedir=/ --dat
 9416 root      18   0 17660 14392  1364 S  0.0  0.7  0:04.90 lfd - sleeping
27699 mysql     18   0 85092 52560  4508 S  0.0  2.5  0:00.68 /usr/sbin/mysqld --basedir=/ --dat
26524 mysql     17   0 85092 52560  4508 S  0.0  2.5  0:00.81 /usr/sbin/mysqld --basedir=/ --dat
 
Status
Not open for further replies.
Back
Top