My two ubuntu multi-core processor servers (tomcat and mysql) are usually down. Therefore, I need a way to limit the cpu to 90% to ensure my servers is responsive (then, i can remote via ssh). I found a package in ubuntu, cpulimit. However, it seems not able to set limit for multi-core processors. Any suggestions?
Chamnap's questions
I'm using nginx + passenger. I'm trying to understand the nginx response 200 and 304. What does this both means? Sometimes, it responses back in 304 and others only 200. Reading the YUI blog, it seems browser needs the header "Last-Modified" to verify with the server. I'm wondering why the browser need to verify the last modified date. Here is my nginx configuration:
location / {
root /var/www/placexpert/public; # <--- be sure to point to 'public'!
passenger_enabled on;
rack_env development;
passenger_use_global_queue on;
if ($request_filename ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|swf)$) {
expires max;
break;
}
}
How would I add the header "Last-Modified" to the static files? Which value should I set?
I'm developing a rails web services with ngnix + passenger, and I use reverse proxy cache in nginx. It works quite well and very fast. The problem is that some clients don't support gzip while some others support.
What I found out is that nginx caches the gzip content, therefore if the gzip-supported clients request first, then the non-gzip clients request, the server still returns gzip content even if the client sends the header "Accept-Encoding": "".
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;
Do you have to cache them separately by combining the request_uri and header 'Accept-Encoding'?
I'm using nginx reverse proxy cache with gzip enabled. However, I got some problems from Android applications HTTP-requests to my Rails JSON web service. It seems when I turn off reverse proxy cache, it works ok because the response header comes without gzip. Therefore, I think the problem is caused by gzip. What is the most appropriate level of gzip compression?
gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css text/javascript application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss;
I wonder on my staging server, whenever I run ps aux, it'll stuck. It outputs a list of process and stop responding. I checked there is enough RAM (1GB).
When I run the top command, it looks ok to me, but I wonder there is one zombie process. What's that? Anyone can explain?
top - 11:00:29 up 3:53, 2 users, load average: 51.75, 50.52, 45.38
Tasks: 79 total, 1 running, 77 sleeping, 0 stopped, 1 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1747660k total, 603572k used, 1144088k free, 12644k buffers
Swap: 917496k total, 0k used, 917496k free, 97732k cached
Thanks