Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2006, 08:56 PM
cycomate1 cycomate1 is offline
 
Join Date: Oct 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default compress mysql responses / cache them

Hi everyone,

I'm running vB and it's database on different servers. A forum hit consumes around 350 kB of traffic (from the database server to the webserver) - that makes more than 100 GB per month.
I already tried the MYSQL_CLIENT_COMPRESS flag but it seems not to be working:
Code:
@@ -272,3 +272,3 @@ class vB_Database
                {
-                       $link = $this->functions[$usepconnect ? 'pconnect' : 'connect']("$servername:$port", $username, $password);
+                       $link = $this->functions[$usepconnect ? 'pconnect' : 'connect']("$servername:$port", $username, $password, MYSQL_CLIENT_COMPRESS);
                }
I still see the database content rushing in clear text.
However, a self-written php file that queries the database using MYSQL_CLIENT_COMPRESS works fine, the result gets compressed.

I saw there is many unvarying data being transferred on each forum hit - like the forum templates, phrases, permissions etc. In fact that's the majority of what's being transferred.
Is there a way of caching these tables locally (in php, on the webserver's side)? If not, how to compress the data?

Regards,
cycomate
Reply With Quote
  #2  
Old 11-12-2006, 11:11 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are your mysql and web servers not directly bridged? And is your provider charging your for the bandwidth that they use to comminucate?

Weird, I personally wouldnt even start to think about sending any communications like this over any sort of public network.
Reply With Quote
  #3  
Old 11-13-2006, 09:12 AM
cycomate1 cycomate1 is offline
 
Join Date: Oct 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The servers are on different networks.
It's the only possibility for me to run vB on two webservers with one database (load balancing). I was using ssh to tunnel the sql queries but encryption and compression was too heavy for the machines at high traffic and whenever the ssh tunnel was interrupted the forum I had to check and restart them, which made the forum unusable for some time. A direct mysql connection is far better but insecure?.

So, to get back on topic, is there a way of caching tables or compressing the mysql connection?

?) just to make it clear: I am currently using an ssh tunnel for the communication between the web servers and the database. The traffic for a forum hit is around 350 kB w/o encryption plus ~50 to 75 kB encryption overhead (I disabled the encryption for measuring purpose). I was asking for MYSQL_CLIENT_COMPRESS because I believe letting mysql handle the compression could be better than leaving it to ssh. And there is much unvarying data (forum templates, phrases, ..) that's being transferred over and over each time someone hits the forum. Caching this content on webserver-side would be great.
Reply With Quote
  #4  
Old 11-13-2006, 03:46 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to me the better option would be for you to either get new servers that are closer, or new servers that are cross connected. For your own sake.
Reply With Quote
  #5  
Old 11-13-2006, 04:07 PM
cycomate1 cycomate1 is offline
 
Join Date: Oct 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting new servers is not an option to me.

Well it seems there's no solution of caching static content on the webserver-side. I'm still curious why MYSQL_CLIENT_COMPRESS won't work.
Reply With Quote
Reply


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 10:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04106 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete