Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 17, 2011 2:11 am 
Offline
Senior Member

Joined: Thu Aug 05, 2010 11:23 pm
Posts: 64
how to set up one site with two app server, and one database - on three 512 linodes?

I went through the library in regards to high available server set up.

the link down below discusses high available web application set up.
http://library.linode.com/linux-ha/ip-f ... untu-10.04

However, I would like to separate the database to a third linode. And also, set up the app servers with nginx.

I was thinking of using the above link as a reference, and for database I thought about using stand alone database library link.
http://library.linode.com/databases/mys ... 0.04-lucid


It seems it should be pretty straight forward. However, I wonder if there would be write, read issues with data server on mysql.

Any suggestions, constructive criticism welcome.

Thank you.


Top
   
PostPosted: Wed Aug 17, 2011 11:39 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
superdupler wrote:
the link down below discusses high available web application set up.
http://library.linode.com/linux-ha/ip-f ... untu-10.04


That's really more for running mysql on two nodes with failover. What it sounds like you're looking for isn't failover, but instead a load balanced cluster.


Top
   
 Post subject:
PostPosted: Wed Aug 17, 2011 3:15 pm 
Offline
Senior Member

Joined: Thu Aug 05, 2010 11:23 pm
Posts: 64
you are right. I am more interested in the load balanced set up. Two cloned app nodes and communicates with database node.

I was wondering if there would be any issues as far as read and write on the database... I guess the best set up - two load balancer, two app, and two data servers. However, right now for my purposes it is way overkill.

any suggestions welcome


Top
   
 Post subject:
PostPosted: Wed Aug 17, 2011 3:51 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Isn't that what this is solving?

http://www.linode.com/nodebalancers/

See the 3rd example here:
http://library.linode.com/linode-platfo ... ncer-howto


Top
   
 Post subject:
PostPosted: Wed Aug 17, 2011 4:46 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Two app servers using one database server is no problem, from MySQL's perspective. In fact, the odds are good your application already makes multiple connections to MySQL. Read-after-write consistency issues start to come into play when you have multiple database servers, but that's an entirely different ball of fish.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Aug 18, 2011 3:52 am 
Offline
Senior Member

Joined: Thu Aug 05, 2010 11:23 pm
Posts: 64
Thank you for those links. I really appreciate it.

What is the maximum amount of app servers possible on this 'node balancer' set up?

Lets say... when the site gets a high load, would you be able to add 5 app servers? Or even be able to go up to 10 app servers? And all along use only one data server.


Top
   
 Post subject:
PostPosted: Thu Aug 18, 2011 9:04 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I believe there's no pre-defined limit for the number of application servers you can have behind a NodeBalancer. However, there's a default limit of 5,000 concurrent connections, so having more than 5,000 application servers would not yield any additional benefit without upgrading your NodeBalancer plan.

MySQL does have a limit to how many connections it can handle simultaneously. Each additional connection uses a little more memory, so it is a tunable parameter.

There's also a practical limit to how much stuff a single MySQL server can do simultaneously: if you're using MyISAM and have a write-heavy database, you're going to be lucky to get one application server working well. But, with InnoDB, few writes, well-designed indexes and queries, and perhaps a layer of caching to take care of the most-common data needs, it'll hum along nicely.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Aug 18, 2011 1:31 pm 
Offline
Senior Member

Joined: Thu Aug 05, 2010 11:23 pm
Posts: 64
so linode caps out on 5,000 concurrent connections?

Quote:
with InnoDB, few writes, well-designed indexes and queries, and perhaps a layer of caching to take care of the most-common data needs


what do you mean by well-designed indexes and queries?

does 'a layer of caching' means caching queries?


Top
   
 Post subject:
PostPosted: Thu Aug 18, 2011 2:14 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
superdupler wrote:
so linode caps out on 5,000 concurrent connections?


The basic NodeBalancer plan caps out at 5,000 concurrent connections. However, there's no hard connection limit on a Linode, but the kernel and your applications might have limits.

Quote:
what do you mean by well-designed indexes and queries?


You typically query a database using SQL, and how the query is designed can drastically change the amount of time it takes to run. Most SQL databases also support indexes, which are somewhat like the index in the back of a book: instead of scanning through an entire book looking for the word 'gazpacho', an index tells the database that the word 'gazpacho' appears in a specific place.

Query design and indexing and SQL server tuning are an art, and they are quite application-specific. They're also the sort of thing that you don't want to optimize prematurely: it doesn't make much sense to shave 50 milliseconds off of a query that, as it turns out, only happens twice a day.

Quote:
does 'a layer of caching' means caching queries?


Or the results from them, at least. If you have queries like SELECT `content` FROM `articles` WHERE slug = 'slug-futures-skyrocket', you can save your database some work by using something like memcached to store the results for quick retrieval later on. Most decent frameworks handle this for you; there's a few rather interesting problems.

Another thing I forgot to mention originally: if you have two application servers and one of them dies, you're OK, because you have a second one. If you have one database server and it dies, you're SOL until it comes back. So, be aware that it's not a high-availability setup, just a load-balancing one. :-)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: sjnorton and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group