xfs_repair -L /dev/centos-home
Error like this:
HDD error: print_req_error: critical medium error, dev sdb, sector xx
Try this one:
1. Reboot use gparted
2. sudo su
3. fdisk -l for lookup error disk, example /dev/mapper/PC--vg-root
4. fsck -f /dev/PC--vg-root (repeat until error gone)
5. e2fsck -fccky /dev/PC--vg-root
6. finish and attach this disk on other fresh install OS
Show used memory for apache process
ps aux | grep 'httpd' | awk '{print $6/1024 " MB";}'
And for resume:
ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
show server MPM
# httpd -V
Server MPM: prefork
And than
MaxRequestWorkers = Total available memory * 80% / Max memory usage of apache process
Example i have 91GB ram, and 50MB max memory per process (usualy per process not more than 100MB)
MaxRequestWorkers = 91000 * 0.8 / 50 = 1400
and than usualy i add 1400+100=1500 for ServerLimit
So configure mpm prefork
#vi /etc/httpd/conf.modules.d/00-mpm.conf
<IfModule mpm_prefork_module>
MaxRequestWorkers 1400
ServerLimit 1500
</IfModule>
# systemctl restart httpd
Check your version of centos
# cat /etc/redhat-release
and then download from this link https://yum.postgresql.org/repopackages.php#pg96 if latest version is Postgresql96
Choose your operating system and then download repository:
# wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm
# rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
# yum update -y
# yum install pgbouncer
Edit pgbouncer.ini, this is example
[databases]
jaringankantorcom_penerimaan = dbname=db_penerimaan host=localhost port=5432 user=xxx_user password=xxx_password
[pgbouncer]
logfile = /home/pgbouncer/pgbouncer.log
pidfile = /home/pgbouncer/pgbouncer.pid
listen_addr = *
listen_port = 6432
auth_type = md5
auth_file = /home/pgbouncer/userlist.txt
admin_users = postgres
stats_users = stats, postgres
pool_mode = transaction
Create your username and password at /home/pgbouncer/userlist.txt
Edit service pgbouncher /etc/init.d/pgbouncer tobe:
pidfile=/home/pgbouncer/pgbouncer.pid
Restart and activate pgbouncer
# service pgbouncer restart
# chkconfig pgbouncer on
For checking yout pgbouncer on, type this command:
# su pgbouncer
pgbouncer $ psql -p 6432 -h localhost -U postgres jaringankantorcom_penerimaan
pgbouncer $ psql -p 6432 -h localhost -U postgres pgbouncer