ngnix php apc memcached – connection stay active

Well, one client complain because the server start going to be verry slow. After a short look, I see that where over 20k ESTABLISHED connection from php-fpm to memcached server.

The main problem was that the server didn’t verify if have a connection active and every time was adding a new one.

After a short search we nottice that we have the stable version of memcached ( php module ) , and the new one have something like isPristine function, you won’t find anything on official documentation on pecl site.

So, the fix was to upgrade to memcached-2.0.0b2 .

How to upgrade memcached:

pecl uninstall memcached

pecl install memcached-2.0.0b2

After this you may use into php code  isPristine

 

 

how to set keyword azerty on centos

Well today I face another problem. I use Oracle VM VirtualBox Manager, and because of time consume to install a linux from dvd, I search and download a image from internet.

Well everything was good until I boot up and try to write something on that virtual machine. The keyword was mess up.

I search a little on internet and a lot of people sugested to use  system-config-keyboard however I don’t have any GUI installed, and I wanted to make it work from command line.

Well finally I found that you may fix this by using

loadkeys us

After using this you will see tha path to configuration file, on my server are located  ”/lib/kbd/keymaps/i386/” . There you may find what you need and after that just run loadkeys and the name of the file without map.gz

 

DataStax OpsCenter “not recognize”

Well , today I was trying to install DataStax OpsCenter on a Centos 5.4 ( 5.x ) . After download and configured when to start I see a error. Well this was because on that version the python on that server is 2.4  more exaclty python-2.4.3-44.el5_7.1 .

How to upgrade centos 5.x with python 2.6 ? Well the solution is to yum install python26.

Will install another package and the DataStax OpsCenter will start working.

 

 

Deleting mail in postfix queue (mailq)

Well another problem.

One friend call me  that his server can’t send / receive e-mails. After I got ssh logins I see with mailq that where more then 20000 e-mail on queue.

Well I decided to remove all e-mail from queue  but how to do this.

Well the magic command is :

postsuper -d ALL

this will erase all e-mail from mailq queue

If you want to remove just one e-mail id run

postsuper -d mailID

Hope will help someone.

upstream sent too big header while reading response header from upstream

In the post http://matrafox.info/firephp-on-nginx-zend_db_profiler_firebug-bad-gateway.html  i modiy

fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;

However after a few day I nottice that on firefox I have a lot of 502  bad gateway .  So after a short look on log I see

*62814 upstream sent too big header while reading response header from upstream

So, to fix this I increase the valuse to

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;

I see also that they can be even higher  something like

fastcgi_buffers 4 256k;
fastcgi_buffer_size 128k;