Start redis server => redis-server
redis console => redis-cli
view available databases => config get databases
pubsub channels global*
pubsub channels global_notification_2
pubsub channels global_notification
pubsub channels * => Lists all the available channels
pubsub numsub global_notification_2 => returns the number of subscribers
From unix command line directly
redis-cli PUBSUB CHANNELS
redis-cli PUBSUB NUMSUB global_notification_2
[root@api prod-openmednet-api]# redis-cli PUBSUB CHANNELS
1) "_action_cable_internal"
2) "global_notification_2"
[root@api prod-openmednet-api]# redis-cli PUBSUB CHANNELS global_notification_2
1) "global_notification_2"
[root@api prod-openmednet-api]# redis-cli PUBSUB NUMSUB global_notification_2
1) "global_notification_2"
2) (integer) 2
NGINX configuration:
NGINX configuration:
worker_processes auto;
worker_rlimit_nofile 500000; #=> refer RLIMIT_NOFILE
server {
error_log logs/dev/error.log warn;
listen 80 default_server;
server_name devapi.openmednet.org;
root /home/rubyapps/OMNR5/OpenMedNet-R5/dev-openmednet-api/public;
rails_env development;
passenger_enabled on;
if ($http_user_agent ~* LWP::Simple|BBBike|jorgee) {
return 403;
}
access_log logs/dev/host.dev.access.log main;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /cable {
passenger_app_group_name omndevapi_action_cable;
passenger_force_max_concurrent_requests_per_process 0;
}
}
setting RLIMIT_NOFILE
step: 1
vi /etc/security/limits.conf
add the following two lines at the end of the file
* soft nofile 120000
* hard nofile 120000
mkdir /etc/systemd/system/nginx.service.d
vi /etc/systemd/system/nginx.service.d/nofile_limit.conf
have the following two lines in that file
[Service]
LimitNOFILE=500000
systemctl daemon-reload
systemctl restart nginx.service
or simply set
setsebool -P httpd_setrlimit 1
And then have the following 3 lines of code @ /etc/sysctl.conf
net.core.somaxconn = 4096
fs.file-max = 120000
vm.overcommit_memory = 1
Then don't forget to restart the machine to apply the settings. AFter restart
check "ulimit -n" it should match fs.file-max above
this command too will match
cat /proc/$(cat /opt/nginx/logs/nginx.pid)/limits | grep open.files
Comments
Post a Comment