hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Sharing sessions between servers in cluster
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

Sharing sessions between servers in cluster

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 04-06-2010, 07:24 AM
king12345 king12345 is offline
New Member
 
Join Date: Apr 2010
Posts: 3
*

Sharing sessions between servers in cluster


Hello,
how do you share PHP sessions between servers in cluster ? Our cluster is balanced by server load and every request goes to different server.
PHP sessions are usually saved in /usr/lib/php5, we tried to share this directory between servers using NFS, but NFS doesnt like thousands of small files. We also tried memcached, but the most of CMS has session.save_handler set to file which caused problems.

Any ideas ?
With best regards
King

Reply With Quote


Sponsored Links
  #2  
Old 04-06-2010, 10:01 AM
vapetrov vapetrov is offline
Web Hosting Guru
 
Join Date: Nov 2003
Location: Kherson, Ukraine
Posts: 265
How do you synchronize user's files on all servers?
Seems best way for you is to bind users to server by ip. Some load balancers can do it.

__________________
Private remote administrator of Linux servers - www.petrov.ks.ua
Quality hosting - Host-Web-Site.com

Reply With Quote
  #3  
Old 04-06-2010, 10:30 AM
king12345 king12345 is offline
New Member
 
Join Date: Apr 2010
Posts: 3
User files are mounted to every server using NFS.
Its possible to send every web to some server (if is alive), but our system checks every server load and than decide to which server will request send.

Reply With Quote
Sponsored Links
  #4  
Old 04-06-2010, 12:34 PM
vapetrov vapetrov is offline
Web Hosting Guru
 
Join Date: Nov 2003
Location: Kherson, Ukraine
Posts: 265
Load balancing per session (per ip) shall work same fine like balancing per request if you have a lot of visitors.
For NFS you can try to perform same optimization to low nfs latency. But it will not helps significantly.

I suggest you to use memcache session storage by default.
I guess the best way to prevent users to set session.save_handler is by means of users persuasion. The forced ways like recompile php without "files" session storage support look to cruel.

__________________
Private remote administrator of Linux servers - www.petrov.ks.ua
Quality hosting - Host-Web-Site.com

Reply With Quote
  #5  
Old 04-06-2010, 12:39 PM
king12345 king12345 is offline
New Member
 
Join Date: Apr 2010
Posts: 3
What happen if someone will try to set session.save_handler to files and this option will not be compilled in ?

Reply With Quote
  #6  
Old 04-06-2010, 03:08 PM
squirrelhost squirrelhost is offline
Web Hosting Evangelist
 
Join Date: Nov 2003
Location: Marylebone, London, UK
Posts: 526
Is this simply running your own website(s), or multiple websites using shared hosting?

If it's your own, you can choose one (or more) of the servers to act as a 'session' server. You can roll your own code to do this if you feel adventurous, or you can use one of several off-the-shelf solutions.

Not wishing to preach for one solution as the best, if you wish you can PM me for a quick solution.

__________________
blog website

Reply With Quote
  #7  
Old 04-06-2010, 05:09 PM
vapetrov vapetrov is offline
Web Hosting Guru
 
Join Date: Nov 2003
Location: Kherson, Ukraine
Posts: 265
Quote:
Originally Posted by king12345 View Post
What happen if someone will try to set session.save_handler to files and this option will not be compilled in ?
Error. So, users will forced to edit CMS options or php code.

__________________
Private remote administrator of Linux servers - www.petrov.ks.ua
Quality hosting - Host-Web-Site.com

Reply With Quote
  #8  
Old 04-06-2010, 05:13 PM
cselzer cselzer is offline
Web Hosting Master
 
Join Date: Apr 2009
Location: Pittsburgh, Pennsylvania
Posts: 582
you could write a custom session handler to do it with a database of some sort. Whether it be sql server, mysql, postgresql... Just a thought. Or mount drives like mentioned previously.

Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
php sessions vs cookie sessions ncix Programming Discussion 13 04-05-2010 04:24 PM
Best servers for cluster? threemints Dedicated Server 19 05-11-2009 06:44 PM
Sharing Sessions across multiple Domains jon31 Programming Discussion 3 08-14-2008 01:25 PM
Cluster servers lexington Dedicated Server 2 07-14-2006 08:10 PM
How to cluster servers? auctionscape Dedicated Server 8 05-06-2005 10:40 AM

Related posts from TheWhir.com
Title Type Date Posted
HostGee Introduces Reseller Hosting Program Web Hosting News 2013-06-12 11:02:08
Web Host Nexcess Expands Options for Enterprise Magento Hosting Web Hosting News 2013-02-04 15:57:35
Web Host HostGee Rolls Out Managed Firewall Cluster Service Web Hosting News 2012-10-22 15:36:38
Swedish Police Raid Web Host PRQ, Take Down File-Sharing and Streaming Sites Web Hosting News 2012-10-02 11:19:32
Cloud Startup Nutanix Launches New Storage Cluster Software Web Hosting News 2011-08-16 16:43:04


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?