更改PHP会话的前缀(nginx,memcached)

I'm using memcached as my session handler in PHP. I setup a second Wordpress instance on a new domain and now ALL vhosts start really slow (from 200ms to 8 seconds).

I have seperate document roots, databases,... but all domains share the same session namespace memc.sess.key.<session_id>, which is, I think, the issue for the latency.

How can I change the prefix for each domain used in PHP session?

E.g.

memc.sess.domain1.key.<session_id>
memc.sess.domain2.key.<session_id>

In the nginx config, I put:

fastcgi_param PHP_VALUE memcached.sess_prefix=memc.sess.domain1.key.;

This now seperates the sessions for each domain.

The site is still slow :-(

Solution for the slowness:

giant:~# tail -f /var/log/php5-fpm.log
[04-May-2014 21:29:50] WARNING: [pool www]
    server reached pm.max_children setting (50), consider raising it

Adjusting the pm_* and server/process variables in the config helped and the site is now running again with blazing speed.