Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:47:59+00:00 2026-05-23T14:47:59+00:00

I use PHP and MySQL to manage the content on my server/site (I have

  • 0

I use PHP and MySQL to manage the content on my server/site (I have a video site).
Lately, the results of any page started coming really slow, not like any other site.

The CPU and Memory of the server are at 0-5% so overhead is not a problem.
What I do is query a database for entries and then show them, along with their thumbanil/score and other info.
What happens is when I open a results page, it does not get all the results at once, they add up one by one.
Is that normal?! of course not…to understand better: what happens is that the header loads, and then the content (many thumbnails linking to other pages) starts loading, but like this: the first 3 thumbs appear, then the next 4, then the next 2, then 4,then… until the end, when finally the bottom of my page loads, meaning the contact link and ToS.

Is there any idea crossing your mind?

I mention that my server has good hardware condition, strong CPU and lots of RAM which are all at a minimum of used % and also mention that the ping to my server is around 40ms (I live in central Europe, the server is in Chicago)

My database contains around 10,000 entries, each page shows 24 entries which are being processed each by this php script:

while($arr=mysql_fetch_array($result)){
    ?>
<div class="thumb" align="center">
<?php
    echo "<a href='videos/".$arr['title'].".php'>";
    ?>
<img src="thumbs/<?php  
$title=basename($arr['address']);
$title=substr($title,0,strlen($title)-4); 
echo $title;
?>_5.jpg" onMouseOver="startThumbSlide('<?php echo $title; ?>', '5', 'thumbs/<?php echo $title.'_'; ?>')" onMouseOut='stopThumbSlide();' id='pic_<?php echo $title; ?>'  width="200px" height="150px"/>
<br />
<div align="left">
<?php
rating_form($arr['address']);
echo '</div>';
echo "</a>";
echo "<a href='videos/".$arr['title'].".php' class=\"thumba\"     onMouseOver=\"startThumbSlide('".$title."', '5', 'thumbs/".$title.'_'."')\" onMouseOut='stopThumbSlide();'>".$arr['title']."</a><br>
<span style=\"font: normal 10px verdana; color:#999;\">Viewed: ".$arr['views']." times</span>".'
<span style="float:right; font: normal 10px verdana; color:#999;">'.$arr['lenght'].'</span>    </center>'."
</div>";}

Thanks a million times in advance to any advise you might give me!
Cheers!

PS: I have to add that the traffic has not changed, actually the site worked better 2 weeks ago when I had double the traffic I have now, and no settings were changed on my server, just slight scripting changes, but I can’t remember exactly what I changed when this started happening…

Edit: Here is the MySQL query I use to get my data from the database, including search string manipulation, the search string variable is $s, this code comes after I have stripped tags and trimmed it.
Here is the code:

$pattern='/[^a-zA-Z0-9]+/';
$s=preg_replace($pattern,' ',$s);
$query="SELECT
    *, 
    CASE when title like '%".$s."%' then 1 else 0 END as titlematch, 
    CASE when tags like '%".$s."%' then 1 else 0 END as tagsmatch,
    MATCH (title, tags) AGAINST ('*".$s."*' IN BOOLEAN MODE) AS relevance
FROM videos
WHERE
    (title like '%".$s."%' OR
    tags like '%".$s."%' OR
    MATCH (title, tags) AGAINST ('*".$s."*' IN BOOLEAN MODE))
AND page=1
ORDER by
    titlematch desc, tagsmatch desc, relevance desc
";

$all = mysql_query($query);

$total = mysql_num_rows($all);
if($total>0){
$n1=$start-1;

$result = mysql_query($query. " LIMIT $n1,$max");

while($arr=mysql_fetch_array($result)){
[...This part is already posted...]

Also, I would like to add that I currently have 2 indexes, one for the index field and one fulltext, for the title and tags fields.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:48:00+00:00Added an answer on May 23, 2026 at 2:48 pm

    The short answer is, it can be very difficult to diagnose problems like these. But there are some tools that might shed some light on the problem, and lead you to a more specific area to focus on.

    First, I’d start with a basic internet speed test, like: http://www.speedtest.net/ Verify that everyone else’s pages are in fact loading quickly.

    Then, just for kicks, get someone outside your country to try to load your site, and see if it’s slow for them too. You might be able to try this yourself by loading your site through a foreign proxy. I suggest all this because those who control the pipes are known to throttle things that are using a lot of bandwidth, like videos sites, for example.

    While it sounds like it’s the HTML that is loading slowly, and not necessarily server processing speed, it couldn’t hurt to check your database speed. I’d use a tool like phpMyAdmin, and run your SQL query and just see if the results return quickly. If they’re slow, it could be an inefficiently written SQL query, or some database settings that need to be tweaked. Just doing a Google search for “mySQL suddenly very slow” brings up many posts that are resolved simply by updating to the latest version of mySQL.

    Those are all the ideas I have for now. Let me know if you discover anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: Our site is built in PHP and uses MySQL databases. I already manage
I manage a secured PHP/MySQL web app with extensive jQuery use. Today, a strange
Use PHP and Mysql. Fields in my table (product) are id , full_price ,
I don't use php or mysql but I am trying to upgrade a phpbb
I use php to display a table of data drawn from my mysql database.
I am working on web application that will use PHP & MySQL. Application will
I am trying to use a PHP form (new.php) to update 2 MySQL tables
I'm trying to configure a PHP installation (5.4.3) with MYSQL (5.0.91) for use with
what is PHP's safest encrypt/decrypt method, in use with MySQL - to store let's
We use Windows for our development systems. I am installing PHP, Apache, MySQL manually.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.