|
之前vps是256的 开3个 nginx进程 8个php-fpm进程(动态模式)
开机占用大概120m左右的内存,运行一段时间后基本上256就满了 然后restart php-fpm能够释放一些内存出来
现在升级到512m的内存,发现512也运行一段时间就满了
请教一些 如何优化一些系统- total used free shared buffers cached
- Mem: 524464 485200 39264 0 36760 355320
- -/+ buffers/cache: 93120 431344
- Swap: 262136 0 262136
复制代码- [root@centos ~]# ps aux
- USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
- root 1 0.0 0.1 2176 744 ? Ss Aug09 0:00 init [3]
- root 2 0.0 0.0 0 0 ? S< Aug09 0:00 [migration/0]
- root 3 0.0 0.0 0 0 ? SN Aug09 0:00 [ksoftirqd/0]
- root 4 0.0 0.0 0 0 ? S< Aug09 0:00 [watchdog/0]
- root 5 0.0 0.0 0 0 ? S< Aug09 0:00 [events/0]
- root 6 0.0 0.0 0 0 ? S< Aug09 0:00 [khelper]
- root 7 0.0 0.0 0 0 ? S< Aug09 0:00 [kthread]
- root 9 0.0 0.0 0 0 ? S< Aug09 0:00 [xenwatch]
- root 10 0.0 0.0 0 0 ? S< Aug09 0:00 [xenbus]
- root 17 0.0 0.0 0 0 ? S< Aug09 0:00 [kblockd/0]
- root 18 0.0 0.0 0 0 ? S< Aug09 0:00 [cqueue/0]
- root 22 0.0 0.0 0 0 ? S< Aug09 0:00 [khubd]
- root 24 0.0 0.0 0 0 ? S< Aug09 0:00 [kseriod]
- root 84 0.0 0.0 0 0 ? S Aug09 0:00 [khungtaskd]
- root 85 0.0 0.0 0 0 ? S Aug09 0:00 [pdflush]
- root 86 0.0 0.0 0 0 ? S Aug09 0:00 [pdflush]
- root 87 0.0 0.0 0 0 ? S< Aug09 0:00 [kswapd0]
- root 88 0.0 0.0 0 0 ? S< Aug09 0:00 [aio/0]
- root 229 0.0 0.0 0 0 ? S< Aug09 0:00 [kpsmoused]
- root 248 0.0 0.0 0 0 ? S< Aug09 0:00 [kstriped]
- root 259 0.0 0.0 0 0 ? S< Aug09 0:00 [kjournald]
- root 280 0.0 0.0 0 0 ? S< Aug09 0:00 [kauditd]
- root 308 0.0 0.1 2268 572 ? S<s Aug09 0:00 /sbin/udevd -d
- root 603 0.0 0.0 0 0 ? S< Aug09 0:00 [kmpathd/0]
- root 604 0.0 0.0 0 0 ? S< Aug09 0:00 [kmpath_handlerd]
- root 807 0.0 0.1 1828 624 ? Ss Aug09 0:00 syslogd -m 0
- root 810 0.0 0.0 1776 412 ? Ss Aug09 0:00 klogd -x
- root 824 0.0 0.2 7220 1064 ? Ss Aug09 0:00 /usr/sbin/sshd
- root 835 0.0 0.2 2564 1196 ? S Aug09 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe
- mysql 912 0.6 8.5 328588 44856 ? Sl Aug09 1:37 /usr/local/mysql/bin/mysqld --basedir=/u
- root 950 0.0 0.0 2008 472 ? Ss Aug09 0:00 gpm -m /dev/input/mice -t exps2
- root 974 0.0 0.2 3348 1128 ? Ss Aug09 0:00 crond
- root 980 0.0 0.1 5984 712 ? Ss Aug09 0:00 nginx: master process /usr/local/nginx/s
- www 981 0.0 0.3 6312 1676 ? S Aug09 0:01 nginx: worker process
- www 982 0.0 0.2 6280 1572 ? S Aug09 0:01 nginx: worker process
- www 983 0.0 0.3 6232 1628 ? S Aug09 0:02 nginx: worker process
- root 991 0.0 0.0 1760 456 tty1 Ss+ Aug09 0:00 /sbin/mingetty tty1
- root 992 0.0 0.0 1760 456 tty2 Ss+ Aug09 0:00 /sbin/mingetty tty2
- root 993 0.0 0.0 1760 460 tty3 Ss+ Aug09 0:00 /sbin/mingetty tty3
- root 994 0.0 0.0 1760 456 tty4 Ss+ Aug09 0:00 /sbin/mingetty tty4
- root 995 0.0 0.0 1760 460 tty5 Ss+ Aug09 0:00 /sbin/mingetty tty5
- root 996 0.0 0.0 1760 456 tty6 Ss+ Aug09 0:00 /sbin/mingetty tty6
- root 997 0.0 0.0 1760 460 xvc0 Ss+ Aug09 0:00 /sbin/mingetty xvc0
- root 2161 0.0 0.5 72596 3012 ? Ss 00:23 0:00 php-fpm: master process (/usr/local/php/
- www 2162 0.0 1.1 72996 6076 ? S 00:23 0:00 php-fpm: pool www
- www 2163 0.0 1.1 72996 5876 ? S 00:23 0:00 php-fpm: pool www
- www 2164 0.0 1.5 73288 8012 ? S 00:23 0:00 php-fpm: pool www
- www 2165 0.0 1.5 73588 7972 ? S 00:23 0:00 php-fpm: pool www
- www 2166 0.0 1.5 73596 8052 ? S 00:23 0:00 php-fpm: pool www
- www 2167 0.0 1.4 73584 7600 ? S 00:23 0:00 php-fpm: pool www
- www 2168 0.0 1.7 77600 9068 ? S 00:23 0:00 php-fpm: pool www
- www 2169 0.0 1.7 77600 9376 ? S 00:23 0:00 php-fpm: pool www
- root 2255 0.2 0.5 10048 2884 ? Ss 00:27 0:00 sshd: root@pts/0
- root 2259 0.2 0.2 5020 1528 pts/0 Ss 00:27 0:00 -bash
- root 2282 0.0 0.1 4608 992 pts/0 R+ 00:27 0:00 ps aux
复制代码- top - 00:29:21 up 4:09, 1 user, load average: 0.12, 0.05, 0.01
- Tasks: 55 total, 2 running, 53 sleeping, 0 stopped, 0 zombie
- Cpu(s): 1.0%us, 0.0%sy, 0.0%ni, 96.3%id, 0.3%wa, 0.0%hi, 0.0%si, 2.3%st
- Mem: 524464k total, 497876k used, 26588k free, 37116k buffers
- Swap: 262136k total, 0k used, 262136k free, 356692k cached
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
- 982 www 15 0 6280 1648 860 S 0.7 0.3 0:01.72 nginx
- 1 root 15 0 2176 744 644 S 0.0 0.1 0:00.08 init
- 2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
- 3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
- 4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
- 5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0
- 6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
- 7 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
- 9 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 xenwatch
- 10 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 xenbus
- 17 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kblockd/0
- 18 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
- 22 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
- 24 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
- 84 root 21 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
- 85 root 15 0 0 0 0 S 0.0 0.0 0:00.02 pdflush
- 86 root 15 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
- 87 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0
- 88 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
- 229 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
- 248 root 18 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
- 259 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kjournald
- 280 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
- 280 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
- 308 root 21 -4 2268 572 376 S 0.0 0.1 0:00.05 udevd
- 86 root 15 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
- 87 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0
- 88 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
- 229 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
- 248 root 18 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
- 259 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kjournald
复制代码
[ 本帖最后由 richie 于 2011-8-10 12:29 编辑 ] |
|