Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Big Board Discussions

Reply
 
Thread Tools
Multiple server Nic cards-public and private Details »»
Multiple server Nic cards-public and private
Version: , by alexi alexi is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-23-2006 Last Update: Never Installs: 0
 
No support by the author.

I have seen a lot of questions on this subject and I happend to have some graphs handy so I thought I would put up a post that should help all "big" boards understand this a little better.
In a multi server setup the web server needs to talk to 2 different places. The internet so users can come and get their data and the database server to get the information they are requesting. This diagram shows that relationship:


The web server should have 2 seperate NIC cards, one facing the internet and 1 facing the database server. Even if your traffic is not that high trying to do this over 1 nic card is not a good idea because database requests will have to wait for the web requests.
The database server NIC will handle far more traffic than the public NIC. Let's look at some graphs. This graph shows 24 hours on my web server. That would be about 300 users at the low and 2200 simoultaneous users at peak



The blue line represents the amount of data going out to the users, the green line represents the data coming in. Notice that there is far more going out as the web server serves up the pages. The "95th percentile" a measure of how much bandwidth you use is 4.97 mbits or megabits per second so out to the users a 10 based connection would be more than enough.

Here is the same graph between the webserver and the database server:



In this case the blue line, way at the bottom represents the data from the web server to the database server. The green lines are the database server returning data to the web server. Notice how much more data goes over this connection than actually goes out to the users. That is one of the reasons it is so important to have it on a seperate nic card. Also note that the 95th percentile is 38.8 mbit so you would not be able to run a 10 based nic card you need a 100 based to not create a bottleneck. It is not neccesary to run a gigabit card although you would still see some improvement from that as it would let stuff get "off the wire" quicker at peak load.

Hope this helps!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-23-2006, 09:05 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nicely demonstrated.
Reply With Quote
  #3  
Old 03-24-2006, 04:21 AM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's some crazy backend traffic. Do you have the attachments stored in the database?
Reply With Quote
  #4  
Old 03-24-2006, 10:26 AM
alexi alexi is offline
 
Join Date: Feb 2002
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, avatars and the like but we don't do any downloadable attachments
Reply With Quote
  #5  
Old 03-24-2006, 06:42 PM
libertate's Avatar
libertate libertate is offline
 
Join Date: Feb 2005
Location: Kiribati
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is good information.

What I love to see is the correlation between how much goes out to the user vs. how much the server needs.

Why is there a need for the DB server to ship 40Mbits to the Web server, when the Web server only serves up, at most 4Mbits? Clearly a lot of the data is discared.

This is where stored routines on the DB server would come very handy. Instead of requesting a record, manipulating, then requesting an other record, manipulating... etc. 4,000 times - it could be shifted to the DB server.

Anyone experiment with rewriting some of the more DB intensive routines as stored routine?
Reply With Quote
  #6  
Old 03-28-2006, 02:11 PM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On every forum page request, a web server requests from a db server:

1. datastore (896KB here), includes forum cache which may be quite big if you have lots of forums (we do)
2. style data (20+KB here)
3. whole set of templates for that forum page - up to 50 templates for a single showthread.php! it's difficult to estimate their size, assuming every template is 1KB, it adds another 50KB for every request
4. some other relevant data: session info, user info, forum/thread/post info, threads/posts themselves, etc

So for a single 50KB showthread page web server slurps about 1MB from the database. Scary, huh? And no, stored procedures won't help here as you need all that information on the web server to properly format and output the pages.

The proper solution would be to cache datastore, styles and templates in some kind of memory cache (like memcached, eaccelerator, apc).
Reply With Quote
  #7  
Old 03-29-2006, 02:33 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

At the moment I cache the datastore using eAccelerator which helps a lot using the inbuilt config.php info (bearing in mind that it is not supported by vB as this is buggy).
Reply With Quote
  #8  
Old 03-29-2006, 04:45 AM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We cache the datastore, the style data and templates in eAccelerator's shared memory, too. Helps to decrease a backend traffic a lot.
Reply With Quote
  #9  
Old 03-29-2006, 04:59 PM
hidjra hidjra is offline
 
Join Date: Jan 2002
Location: Amsterdam
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kmike
We cache the datastore, the style data and templates in eAccelerator's shared memory, too. Helps to decrease a backend traffic a lot.
This sounds interresting. How did you accomplish this?

Grtz,
Hidjra :bunny:
Reply With Quote
  #10  
Old 03-30-2006, 04:07 PM
kmike kmike is offline
 
Join Date: Oct 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Obviously, by the great deal of hacking.
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04276 seconds
  • Memory Usage 2,285KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete