CentOS6.5 character set optimization

Source: Internet
Author: User
These two days just good to do PHP-FPM memory optimization, in the view of PHP-FPM memory usage found locale-archive memory 96 M, the file is language, environment, font-related index files, because many languages are useless, they are deleted to squeeze the memory. any setlocale program will map the locale-archive file to the memory usage details.

These two days just good to do PHP-FPM memory optimization, in the view of PHP-FPM memory usage found locale-archive memory 96 M, the file is language, environment, font-related index files, because many languages are useless, deleting them to squeeze the memory. any setlocale program will map the locale-archive file to the memory.

Memory usage details

  [Root @ AY14070313210045657aZ ~] # Pmap-d 'pidof php-fpm | awk '{print $1}' '7124: php-fpm: pool www Address Kbytes Mode Offset Device Mapping0000000000400000 11028 r-x -- 0000000000000000 0ca: 00001 php-fpm00000000010c5000 116 rw --- 0000000000ac5000 0ca: 00001 php-fpm .... omitting 20177f033ea1a000 64 r-x -- 0000000000000000 0ca: 00001 libGB. so00007f033ea2a000 2044 ----- 0000000000010000 0ca: 00001 libGB. so00007f033ec29000 4 r ---- zookeeper F000 0ca: 00001 libGB. soft-7f033ec2a000 4 rw --- 0000000000010000 0ca: 00001 libGB. so00007f033ec2b000 12 r-x -- 0000000000000000 0ca: 00001 EUC-CN.so00007f033ec2e000 2044 ----- 0000000000003000 0ca: 00001 EUC-CN.so00007f033ee2d000 4 r ---- 0000000000002000 0ca: 00001 EUC-CN.so00007f033ee2e000 4 rw --- 0000000000003000 0ca: 00001 EUC-CN.so00007f033ee2f000 96832 r ---- 0000000000000000 0ca: 00001 locale-archive00007f0344cbf000 48 r-x -- 0000000000000000 0ca: 00001 libnss_files-2.12.so00007f0344ccb000 2048 ----- 000000000000c000 0ca: 00001 libnss_files-2.12.so00007f0344ecb000 4 r ---- 000000000000c000 0ca: 00001 libnss_files-2.12.so00007f0344ecc000 4 rw --- 000000000000d000 0ca: 00001 libnss_files-2.12.so00007f0344ecd000 28 r-x -- 0000000000000000 0ca: 00001 pdo_mysql.so%7f0344ed4000 2044 ----- 0000000000007000 0ca: 00001 pdo_mysql.so%7f03450d3000 4 rw --- 0000000000006000 0ca: 00001 pdo_mysql.so

 

Make corresponding adjustments (here, consider what the application needs as appropriate)

  ### Rename the file ### [root @ ipython ~] # Mv/usr/lib/locale-archive/usr/lib/locale/locale-archive.bak ### re-add language support ### [root @ ipython ~] # Localedef-I en_US-f UTF-8 en_US.UTF-8 [root @ ipython ~] # Localedef-I zh_CN-f UTF-8 zh_CN.UTF-8 ### optional Chinese support ### [root @ ipython ~] # Localedef-I zh_CN-f GB2312 zh_CN [root @ ipython ~] # Localedef-I zh_CN-f GB2312 zh_CN.GB2312 [root @ ipython ~] # Localedef-I zh_CN-f GBK zh_CN.GBK ### supported by Fu Zhongwen (HK/TW/SG) ### [root @ ipython ~] # Localedef-f UTF-8-I zh_HK zh_HK.UTF-8 [root @ ipython ~] # Localedef-f UTF-8-I zh_TW zh_TW.UTF-8 [root @ ipython ~] # Localedef-f UTF-8-I zh_SG zh_SG.UTF-8 #### restart the server, and then check the use of ### [root @ ipython ~] # Pmap-d 'pidof php-fpm | awk' {print $1} ''| awk'/locale/'20177f38d0717000 3104 r ---- 0000000000000000 0ca: 00001 locale-archive ### as a result, it will be much smaller. if you need an insurance method, use the following command ### [root @ ipython ~] # Localedef -- list-archive | egrep-v ^ "en_US | zh" | xargs localedef -- delete-from-archive [root @ ipython ~] # Mv-f/usr/lib/locale-archive/usr/lib/locale/locale-archive.bak [root @ ipython ~] # Build-locale-archive

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.