In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to achieve system optimization in CentOS", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to achieve system optimization in RocketMQ in CentOS" this article.
The os.sh optimization script starts with:
#! / bin/sh## Execute Only Once#echo 'vm.overcommit_memory=1' > > / etc/sysctl.confecho' vm.min_free_kbytes=5000000' > > / etc/sysctl.confecho 'vm.drop_caches=1' > > / etc/sysctl.confecho' vm.zone_reclaim_mode=0' > > / etc/sysctl.confecho 'vm.max_map_count=655360' > > / etc/sysctl.confecho' vm.dirty_background_ratio=50' > > / etc/sysctl.confecho 'vm.dirty_ratio=50' > > / etc/sysctl.confecho' Vm.page-cluster=3' > > / etc/sysctl.confecho 'vm.dirty_writeback_centisecs=360000' > > / etc/sysctl.confecho' vm.swappiness=10' > > / etc/sysctl.confsysctl-pecho 'ulimit-n 655350' > > / etc/profileecho' admin hard nofile 655350' > > / etc/security/limits.confDISK= `DF-k | sort-n-r-k 2 | awk-F / 'NR==1 {gsub (/ [0-9]. * / "", $3) Print $3}'`["$DISK" = 'cciss'] & & DISKconversation ccissary c0d0 echo' deadline' > / sys/block/$DISK/queue/schedulerecho "- -" sysctl vm.overcommit_memorysysctl vm.min_free_kbytessysctl vm. Drop_cachessysctl vm.zone_reclaim_modesysctl vm.max_map_countsysctl vm.dirty_background_ratiosysctl vm.dirty_ratiosysctl vm.page-clustersysctl vm.dirty_writeback_centisecssysctl vm.swappinesssu-admin-c 'ulimit-n'cat / sys/block/$DISK/queue/scheduler
This script modifies the network parameters, the hard resource limit of admin, and the flushing mode of the hard disk.
After taking a look, you can't run it directly.
The following changes need to be made
The user admin is used in this script. It is estimated that Ali's mq is started with admin.
If you start one of the RocketMQ with root
Echo 'ulimit-n 655350' > > / etc/profileecho 'admin hard nofile 655350' > > / etc/security/limits.conf
These two lines can be commented out, but it is not recommended to start the service directly with root in the production environment, so I useradd admin it.
The other is the hard disk optimization part.
First of all, you need to know that the file log generated by the RockerMQ run will be placed in the home directory of the running user.
So you can create an admin in the home directory and hang the disk to / home/admin.
Next is the hard disk refresh mode (I Scheduling O)
DISK= `df-k | sort-n-r-k 2 | awk-F / 'NR==1 {gsub (/ [0-9]. * /, ", $3); print $3}' `[" $DISK "= 'cciss'] & & DISKexamples ccissary c0d0 echo' deadline' > / sys/block/$DISK/queue/scheduler
This also does not apply to the author's environment. The aim is to change the flush mode of the hard disk to deadline.
Check the current hard disk flushing mode (the author's hard disk is sda)
# cat / sys/block/sda/queue/schedulernoop anticipatory deadline [cfq]
All right, change it manually.
# echo 'deadline' > / sys/block/sda/queue/scheduler#cat / sys/block/sda/queue/scheduler noop anticipatory [deadline] cfq
This method takes effect immediately, but it will be lost after reboot.
If you need to restart the deadline, you need to add the grub parameter.
Edit / etc/grub.conf
Find the kernel line and add it at the end
Elevator=deadline
So far, the optimizations made in this script have been completed.
Finally, post a copy of the revised by the author (only to change the parameters to facilitate reuse)
Note: (root or sudo permission is required to execute) Please replace the user and drive letter in the script with yours
#! / bin/sh## Execute Only Once can only be executed once # # user name USER=admin# disk letter DISK=sda## add parameter default comment in grub.conf Please uncomment # sed-I's etc/grub.confecho kernel.please uncomment & elevator=deadline/' / etc/grub.confecho 'vm.overcommit_memory=1' > > / etc/sysctl.confecho' vm.min_free_kbytes=5000000' > > / etc/sysctl.confecho 'vm.drop_caches=1' > > / etc/ Sysctl.confecho 'vm.zone_reclaim_mode=0' > > / etc/sysctl.confecho' vm.max_map_count=655360' > > / etc/sysctl.confecho 'vm.dirty_background_ratio=50' > > / etc/sysctl.confecho' vm.dirty_ratio=50' > > / etc/sysctl.confecho 'vm.page-cluster=3' > > / etc/sysctl.confecho' vm.dirty_writeback_centisecs=360000' > > / etc/sysctl.confecho 'vm.swappiness=10' > > / etc/sysctl.confsysctl-pecho "ulimit-n 655350" > > / etc/profileecho "$USER hard nofile 655350" > > / etc/security/limits.confecho 'deadline' > / sys/block/$DISK/queue/schedulerecho "- -" sysctl vm.overcommit_memorysysctl vm.min_free_kbytessysctl vm.drop_cachessysctl vm.zone_reclaim_modesysctl vm .max _ map_countsysctl vm.dirty_background_ratiosysctl vm.dirty_ratiosysctl vm.page-clustersysctl vm.dirty_writeback_centisecssysctl vm.swappinesssu-$USER-c 'ulimit-n'cat / sys/block/$DISK/queue/scheduler
This is the end of the optimization.
These are all the contents of the article "how to achieve system Optimization in RocketMQ in CentOS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.