![]() |
Queries = bandwidth?
Hi Guys,
I'm working on re-designing the main page of my domain to include more includes. Currently I have a few includes for my php banner system (dotbanner). I also have two includes...both similar but for the latest 5 posts from two topic different forums..... I also have another include that pulls the latest post from our "kudos" forum Now i plan on adding a log-in include... and 2 more includes for fresh content daily. (One include will be a thread that I choose weekly for "hot topic" but I didn't want it based on replies...but on best content.) My question? Does this kind of query set up with includes cause a problem for bandwidth? I'm asking because I am php challenged, server admin challenged, and except for the fact that I understand that bandwidth is costly...and larger/more graphics cost more money per visitor, I'm wondering if I'm creating a monster by redesigning my main page of my domain based on includes. Does it matter? Any thoughts or advise? thanks! |
Query and bandwidth are not the same. Queries in general increase your server load by increasing access to the database, hard disk and CPU. Bandwidth is more related to the number of bytes being downloaded from your server, which has an effect on server load too, but is more generic, depending on how much graphics and other large files you have.
|
Thanks Erwin. I had assumed that more queries = increase server load = bandwidth usage....
but if they are unrelated, is it okay to assume that if my server is set for queries okay...and my server load has been averaging 1.2 with my boards, then I'm okay for additional includes on my domain index page? Thanks! |
Your index page shouldn't have over 30 queries ideally. Remember, each include will add all the queries of the included php file into your index.php file as well.
|
So can you help me with this math?
If an include asks to print the last 5 posts of a certain forum in part...with name/title/post up to 60 characters... Is that 5 queries or is that more? |
No, it doesn't work that way. It depends on the PHP code used to retrieve and print the 5 posts. It may be 1 query only. Post the code here - usually (but not always) as a general rule if there is only 1 line that says "query ->" then that's only 1 query.
|
If loading-speed of your pages is an issue, then how you use queries can become an important factor as well. Sometimes calling 2 queries that could have been combined in one bigger query is more efficient, since they will process faster resulting in your page being outputted quicker. Usually it depends on how you are querying the database though, so don't do anything drastically redundant.
Although, if your main goal is to lower server load, try combining similar queries and getting them ideally in the 20's or below for each PHP page. |
I have two includes set up side by side/top to bottom in a column on my index page.
they are only different in the forum they are pulling the posts from: Code:
<?php |
general rule is this:
Whenever you see PHP command "mysql_query" add 1 query to your server load. For vb scripts the keyword is "$DB_site->query" or "$DB_site->query_first".. But sometimes less query doesnt mean the best performance. If your query is too advanced or badly formed, it can sometimes eat more server source than 2 independent queries. But well these are expert tips, for your needs you can count on the idea that less query = less server load. Too much server load is not always bad for all sites. Say you are on dedicated, have a powerful computer or less site visitors, then you can go crazy with your queries. But for many people who are on shared hosting when you increase your queries, it means you are taking the shared server load from your neighbours which you hosting company wouldnt like if you consume too much power very frequently.. |
So this include I'm using....??
I believe we got this from here or vb.com (before org was launched) 2 years ago. I use this same include twice...with a change in forum ID. I'm on a dedicated server...with moderate traffic: 5,000 uniques a day, 2 million page views a month. My vb has over 21,000 members and usually we average 100-125 users on the vb at one time (topped out at 165) I have wanted to add more includes to the index page to change the look of the main page a bit. Do I need this include re- written for better effeciency? thanks for your thoughts. |
All times are GMT. The time now is 09:02 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|