一个php-cgi占用系统多大内存
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了一个php-cgi占用系统多大内存相关的知识,希望对你有一定的参考价值。
参考技术A 在网上翻阅资料的时候会看到有人说一个php-cgi进程大约占用系统内存20M,但是php-cgi占用内存其实是与你的php.ini配置加载多少个.so(.dll)模块相关的,我们在linux系统下查看,可以用pman的命令:pmap $(pgrep php-cgi | head -1)
[root@Smile ~]# pmap $(pgrep php-cgi | head -1)
2830: /home/pubsrv/php/bin/php-cgi --fpm --fpm-config /home/pubsrv/php/etc/php-fpm.conf
0000000000400000 6852K r-x-- /home/pubsrv/php/bin/php-cgi
0000000000cb1000 268K rw--- /home/pubsrv/php/bin/php-cgi
0000000000cf4000 60K rw--- [ anon ]
00000000016fd000 2216K rw--- [ anon ]
0000003c24a00000 128K r-x-- /lib64/ld-2.12.so (deleted)
0000003c24c1f000 4K r---- /lib64/ld-2.12.so (deleted)
0000003c24c20000 4K rw--- /lib64/ld-2.12.so (deleted)
0000003c24c21000 4K rw--- [ anon ]
0000003c24e00000 8K r-x-- /lib64/libdl-2.12.so (deleted)
0000003c24e02000 2048K ----- /lib64/libdl-2.12.so (deleted)
0000003c25002000 4K r---- /lib64/libdl-2.12.so (deleted)
0000003c25003000 4K rw--- /lib64/libdl-2.12.so (deleted)
0000003c25200000 1576K r-x-- /lib64/libc-2.12.so (deleted)
0000003c2538a000 2044K ----- /lib64/libc-2.12.so (deleted)
0000003c25589000 16K r---- /lib64/libc-2.12.so (deleted)
0000003c2558d000 4K rw--- /lib64/libc-2.12.so (deleted)
0000003c2558e000 20K rw--- [ anon ]
0000003c25600000 92K r-x-- /lib64/libpthread-2.12.so (deleted)
0000003c25617000 2048K ----- /lib64/libpthread-2.12.so (deleted)
0000003c25817000 4K r---- /lib64/libpthread-2.12.so (deleted)
0000003c25818000 4K rw--- /lib64/libpthread-2.12.so (deleted)
0000003c25819000 16K rw--- [ anon ]
0000003c25a00000 28K r-x-- /lib64/librt-2.12.so (deleted)
0000003c25a07000 2044K ----- /lib64/librt-2.12.so (deleted)
0000003c25c06000 4K r---- /lib64/librt-2.12.so (deleted)
0000003c25c07000 4K rw--- /lib64/librt-2.12.so (deleted)
0000003c25e00000 524K r-x-- /lib64/libm-2.12.so (deleted)
0000003c25e83000 2044K ----- /lib64/libm-2.12.so (deleted)
0000003c26082000 4K r---- /lib64/libm-2.12.so (deleted)
0000003c26083000 4K rw--- /lib64/libm-2.12.so (deleted)
0000003c26200000 84K r-x-- /lib64/libz.so.1.2.3 (deleted)
0000003c26215000 2044K ----- /lib64/libz.so.1.2.3 (deleted)
0000003c26414000 4K r---- /lib64/libz.so.1.2.3 (deleted)
0000003c26415000 4K rw--- /lib64/libz.so.1.2.3 (deleted)
0000003c26600000 116K r-x-- /lib64/libselinux.so.1.#prelink#.YPfIAE (deleted)
0000003c2661d000 2044K ----- /lib64/libselinux.so.1.#prelink#.YPfIAE (deleted)
0000003c2681c000 4K r---- /lib64/libselinux.so.1.#prelink#.YPfIAE (deleted)
0000003c2681d000 4K rw--- /lib64/libselinux.so.1.#prelink#.YPfIAE (deleted)
0000003c2681e000 4K rw--- [ anon ]
0000003c26a00000 928K r-x-- /usr/lib64/libstdc++.so.6.0.13 (deleted)
0000003c26ae8000 2048K ----- /usr/lib64/libstdc++.so.6.0.13 (deleted)
0000003c26ce8000 28K r---- /usr/lib64/libstdc++.so.6.0.13 (deleted)
0000003c26cef000 8K rw--- /usr/lib64/libstdc++.so.6.0.13 (deleted)
0000003c26cf1000 84K rw--- [ anon ]
0000003c26e00000 88K r-x-- /lib64/libgcc_s-4.4.7-20120601.so.1;529c1fe4 (deleted)
0000003c26e16000 2044K ----- /lib64/libgcc_s-4.4.7-20120601.so.1;529c1fe4 (deleted)
0000003c27015000 4K rw--- /lib64/libgcc_s-4.4.7-20120601.so.1;529c1fe4 (deleted)
0000003c27200000 88K r-x-- /lib64/libresolv-2.12.so (deleted)
0000003c27216000 2048K ----- /lib64/libresolv-2.12.so (deleted)
0000003c27416000 4K r---- /lib64/libresolv-2.12.so (deleted)
0000003c27417000 4K rw--- /lib64/libresolv-2.12.so (deleted)
0000003c27418000 8K rw--- [ anon ]
0000003c27a00000 12K r-x-- /lib64/libplds4.so (deleted)
0000003c27a03000 2044K ----- /lib64/libplds4.so (deleted)
0000003c27c02000 4K r---- /lib64/libplds4.so (deleted)
0000003c27c03000 4K rw--- /lib64/libplds4.so (deleted)
0000003c27e00000 16K r-x-- /lib64/libplc4.so (deleted)
0000003c27e04000 2044K ----- /lib64/libplc4.so (deleted)
0000003c28003000 4K r---- /lib64/libplc4.so (deleted)
0000003c28004000 4K rw--- /lib64/libplc4.so (deleted)
0000003c28200000 228K r-x-- /lib64/libnspr4.so (deleted)
0000003c28239000 2048K ----- /lib64/libnspr4.so (deleted)
0000003c28439000 4K r---- /lib64/libnspr4.so (deleted)
0000003c2843a000 8K rw--- /lib64/libnspr4.so (deleted)
0000003c2843c000 8K rw--- [ anon ]
0000003c28600000 148K r-x-- /usr/lib64/libnssutil3.so (deleted)
0000003c28625000 2044K ----- /usr/lib64/libnssutil3.so (deleted)
0000003c28824000 24K r---- /usr/lib64/libnssutil3.so (deleted)
0000003c2882a000 4K rw--- /usr/lib64/libnssutil3.so (deleted)
0000003c28a00000 408K r-x-- /lib64/libfreebl3.so (deleted)
0000003c28a66000 2048K ----- /lib64/libfreebl3.so (deleted)
0000003c28c66000 4K r---- /lib64/libfreebl3.so (deleted)
0000003c28c67000 4K rw--- /lib64/libfreebl3.so (deleted)
0000003c28c68000 16K rw--- [ anon ]
0000003c28e00000 28K r-x-- /lib64/libcrypt-2.12.so (deleted)
0000003c28e07000 2048K ----- /lib64/libcrypt-2.12.so (deleted)
0000003c29007000 4K r---- /lib64/libcrypt-2.12.so (deleted)
0000003c29008000 4K rw--- /lib64/libcrypt-2.12.so (deleted)
0000003c29009000 184K rw--- [ anon ]
0000003c29200000 1236K r-x-- /usr/lib64/libnss3.so (deleted)
0000003c29335000 2044K ----- /usr/lib64/libnss3.so (deleted)
0000003c29534000 20K r---- /usr/lib64/libnss3.so (deleted)
0000003c29539000 8K rw--- /usr/lib64/libnss3.so (deleted)
0000003c2953b000 8K rw--- [ anon ]
0000003c29600000 160K r-x-- /usr/lib64/libsmime3.so (deleted)
0000003c29628000 2048K ----- /usr/lib64/libsmime3.so (deleted)
0000003c29828000 12K r---- /usr/lib64/libsmime3.so (deleted)
0000003c2982b000 4K rw--- /usr/lib64/libsmime3.so (deleted)
0000003c29a00000 204K r-x-- /usr/lib64/libssl3.so (deleted)
0000003c29a33000 2048K ----- /usr/lib64/libssl3.so (deleted)
0000003c29c33000 8K r---- /usr/lib64/libssl3.so (deleted)
0000003c29c35000 4K rw--- /usr/lib64/libssl3.so (deleted)
0000003c29c36000 4K rw--- [ anon ]
0000003c29e00000 12K r-x-- /lib64/libcom_err.so.2.1 (deleted)
0000003c29e03000 2044K ----- /lib64/libcom_err.so.2.1 (deleted)
0000003c2a002000 4K r---- /lib64/libcom_err.so.2.1 (deleted)
0000003c2a003000 4K rw--- /lib64/libcom_err.so.2.1 (deleted)
0000003c2a200000 100K r-x-- /usr/lib64/libsasl2.so.2.0.23.#prelink#.BXW3hH (deleted)
0000003c2a219000 2044K ----- /usr/lib64/libsasl2.so.2.0.23.#prelink#.BXW3hH (deleted)
0000003c2a418000 4K r---- /usr/lib64/libsasl2.so.2.0.23.#prelink#.BXW3hH (deleted)
0000003c2a419000 4K rw--- /usr/lib64/libsasl2.so.2.0.23.#prelink#.BXW3hH (deleted)
0000003c2aa00000 1488K r-x-- /usr/lib64/libcrypto.so.1.0.0 (deleted)
0000003c2ab74000 2044K ----- /usr/lib64/libcrypto.so.1.0.0 (deleted)
0000003c2ad73000 100K r---- /usr/lib64/libcrypto.so.1.0.0 (deleted)
0000003c2ad8c000 40K rw--- /usr/lib64/libcrypto.so.1.0.0 (deleted)
0000003c2ad96000 16K rw--- [ anon ]
0000003c2ae00000 56K r-x-- /lib64/liblber-2.4.so.2.5.6.#prelink#.IEslwN (deleted)
0000003c2ae0e000 2044K ----- /lib64/liblber-2.4.so.2.5.6.#prelink#.IEslwN (deleted)
0000003c2b00d000 4K r---- /lib64/liblber-2.4.so.2.5.6.#prelink#.IEslwN (deleted)
0000003c2b00e000 4K rw--- /lib64/liblber-2.4.so.2.5.6.#prelink#.IEslwN (deleted)
0000003c2b200000 608K r-x-- /usr/lib64/libfreetype.so.6.3.22.#prelink#.GI1Kfx (deleted)
0000003c2b298000 2044K ----- /usr/lib64/libfreetype.so.6.3.22.#prelink#.GI1Kfx (deleted)
0000003c2b497000 24K rw--- /usr/lib64/libfreetype.so.6.3.22.#prelink#.GI1Kfx (deleted)
0000003c2b600000 260K r-x-- /lib64/libgssapi_krb5.so.2.2.#prelink#.gjYRNu (deleted)
0000003c2b641000 2048K ----- /lib64/libgssapi_krb5.so.2.2.#prelink#.gjYRNu (deleted)
0000003c2b841000 4K r---- /lib64/libgssapi_krb5.so.2.2.#prelink#.gjYRNu (deleted)
0000003c2b842000 8K rw--- /lib64/libgssapi_krb5.so.2.2.#prelink#.gjYRNu (deleted)
0000003c2ba00000 148K r-x-- /usr/lib64/libpng12.so.0.49.0.#prelink#.cL7qH2 (deleted)
0000003c2ba25000 2048K ----- /usr/lib64/libpng12.so.0.49.0.#prelink#.cL7qH2 (deleted)
0000003c2bc25000 4K rw--- /usr/lib64/libpng12.so.0.49.0.#prelink#.cL7qH2 (deleted)
0000003c2be00000 292K r-x-- /lib64/libldap-2.4.so.2.5.6.#prelink#.QXZutL (deleted)
0000003c2be49000 2048K ----- /lib64/libldap-2.4.so.2.5.6.#prelink#.QXZutL (deleted)
total 286016K
[root@Smile ~]#
可以看到我的一个php-cgi占用了大约28M
java怎样配置redis占用多大内存
Redis的配置daemonize 如果需要在后台运行,把该项改为yes
pidfile 配置多个pid的地址,默认在/var/run/redis.pid
bind 绑定ip,设置后只接受自该ip的请求
port 监听端口,默认为6379
timeout 设置客户端连接时的超时时间,单位为秒
loglevel 分为4级,debug、verbose、notice、warning
logfile 配置log文件地址
databases 设置数据库的个数,默认使用的数据库为0
save 设置redis进行数据库镜像的频率,保存快照的频率,第一个*表示多长时间, 第三个*表示执行多少次写操作。在一定时间内执行一定数量的写操作时,自动保存快照。可设置多个条件。
rdbcompression 在进行镜像备份时,是否进行压缩
Dbfilename 镜像备份文件的文件名
Dir 数据库镜像备份的文件放置路径
Slaveof 设置数据库为其他数据库的从数据库
Masterauth 主数据库连接需要的密码验证
Requirepass 设置登录时需要使用的密码
Maxclients 限制同时连接的客户数量
Maxmemory 设置redis能够使用的最大内存
Appendonly 开启append only模式
appendfsync 设置对appendonly.aof文件同步的频率
vm-enabled 是否虚拟内存的支持
vm-swap-file 设置虚拟内存的交换文件路径
vm-max-memory 设置redis使用的最大物理内存大小
vm-page-size 设置虚拟内存的页大小
vm-pages 设置交换文件的总page数量
vm-max-threads 设置VMIO同时使用的线程数量
glueoutputbuf 把小的输出缓存存放在一起
hash-max-zipmap-entries 设置hash的临界值
activerehashing 重新has 参考技术A 没分数,不想回答!
以上是关于一个php-cgi占用系统多大内存的主要内容,如果未能解决你的问题,请参考以下文章