Make your site faster by 89,99% faster.

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

20 replies · 2,317 views · started 15 years ago · 1 min read

TL;DR · summary of 20 replies
  • subzero recommended using a cron job to optimize tables every hour for sites with more than 10 users online.
  • subzero suggested optimizing MySQL once a day at night time when traffic is low.
  • GumSlone advised against running the optimization query during database operations, recommending setting up a cron job instead.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

6 participants
subzero Super moderator Fellow · 3,954 posts #1

Add file called opt.php

to www folder

add All your database like

<?php include("your_config.php"); include("your_core.php"); mysql_query("OPTIMIZE TABLE `users`,`forums`,`chat`") or die("ERROR: DATABASE NOT IN THIS FILE!"); ?>

In order Minute Hour Day Month Weekday 0 * * * *

Now the Command Corn Job /usr/local/bin/php /home/USERNAME/public_html/opt.php>/dev/null

Only Change is in red USERNAME to your cpanel username...

Enjoy

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #3

This will do it for you as far lavalair using alot of cpu as for mysql and owners are fooking lazy to OPTIMIZE TABLE THERE SITE to make it run smoothly and best

Get corn job to do it for you lol

You need to select all in phpmyadmin then OPTIMIZE TABLE it copy your OPTIMIZE TABLE `user thing in phpmyadmin will auto give this code then add it how i show you.

Now when corn job OPTIMIZE TABLE your table it will do it to all tables and make your site run faster.

Also it does not hurt to add your email to get updates on corn jobs

Got the idea now ?

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

khan Lead · 681 posts #4

yep.... Gooood. I personally dnt like lava. Not only for lava users, it will work for those who hv lotsa table in their db. Gonna use it to my next site

subzero Super moderator Fellow · 3,954 posts #5

Thats right this can be used for any site

Also note this does it in a hour time so your tables of more or less

users online | hours / mins / days

1 to 10 = day 1 to 60 = once a day 1 to 100 = 1 hour base 1 to 1000 = 1 min base

So basic your site always OPTIMIZE TABLE it self

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

morency Senior · 488 posts #6

you tested and get a 89.99% better result ? Is just a question ...

I also optimize db table when I log in to panel.

You can add a httpd restart every 3-5 days (I dont know if is ok:D)

Unamos los corazones,hoy todos somos multicolores!

subzero Super moderator Fellow · 3,954 posts #7

restarting httpd is not a good idea as does nothing to phpmyadmin

My old site had 500 + members online and cpu was 1.92% as user was online using httpd i notice once i had 100 members my cpu was 4.99% or more i don't remember its was old lol days but i did this tick ever time user login or brows the site it will optimize the site.

then my cpu jump to 2.99% and it was using mysql too many times so i set corn jobs

got my self a 1.92% adv speed and now i can defate my scripts with gzip so the site is moving hell alot faster then my old one but its has not had users online yet as it is still in beta mode as i don't yet pay to sell ads for my site like i did before...

Prodigits do the same way but in other way as it is in asp coding.

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

morency Senior · 488 posts #8

So , you recommend , for a site ..let's say with 500online users (real ,ofcourse) the cron job to be set to 1m up to 1h ?!

Unamos los corazones,hoy todos somos multicolores!

subzero Super moderator Fellow · 3,954 posts #9

its upto how much bullsh()$*#t users use like

Inboxing Chat Forums Online

or having overhead over 1 kb in phpmyadmin

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

GumSlone Administrator Principal · 1,690 posts #10

morency wrote: So , you recommend , for a site ..let's say with 500online users (real ,ofcourse) the cron job to be set to 1m up to 1h ?!

dont do that, because when the mysql runs the optimize/repair query and some other processes will write data to mysql it may break the table structure, make a cron to optimize mysql once a day, at night time when thr traffic is low.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

GumSlone Administrator Principal · 1,690 posts #12

install memcached to cache your database query results (facebook and vkontakte use it too), use templates engine like smarty, avoid multiple css/javascript files, compress css/javascript, also use nginx reverse proxy for static content (big russian sites like rambler and vkontakte use it), you can also use mysql table type memory instead of myisam if you want store the data temporarily, eg for online users or chat messages.

this is actually the best way to speed up your site.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #13

i installed nginx on my billing server and it had the up most crapped out lol i mean 100 was on it then boom dead server....

Unstalled nginx 100+ on billing fine lol wtf

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

GumSlone Administrator Principal · 1,690 posts #14

subzero wrote: i installed nginx on my billing server and it had the up most crapped out lol i mean 100 was on it then boom dead server....

Unstalled nginx 100+ on billing fine lol wtf

works fine for me, the server can handle now about 40% more users as it was before.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #15

i mite know why lol

  1. Script i use is apache and Nginx lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

morency Senior · 488 posts #16

I moved on other hosting company ... better server 3x times more RAM .. CPU average load is max 0.5% :-| nginx sux for me because I was unable to configure so I moved my ass in other place . I made few optimisation in queries + gzip + I blocked Indian users ( lol?! ) Soon i will make the page caching .. just need to up my users with 2-400+ online to have a motivation

Unamos los corazones,hoy todos somos multicolores!

GumSlone Administrator Principal · 1,690 posts #17

morency wrote:

  • I blocked Indian users ( lol?! )

Lol, this is another way to reduce the server ressources usage 🙂

  • you can block pc, t9space proxy, opera mini and ucweb browsers

all t9space and ucweb users have us ip's and dont send any x_forwarded_for headers.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

morency Senior · 488 posts #18

PC not blocked for the moment .:) The only app browsers who send headers there are opera mini and bolt HTTP_X_BOLT_PHONE_UA HTTP_X_OPERAMINI_PHONE_UA I dont know others . I think only indians users come from t9space ..

ohh , I remember i changed the mysql connection type , from mysql_connect to mysql_pconnect (persistent one) . I read is good for sites with big traffic .. the persistent connection dont make a new connection each time a PHP page is called up.

Unamos los corazones,hoy todos somos multicolores!

GumSlone Administrator Principal · 1,690 posts #19

morency wrote: PC not blocked for the moment .:) The only app browsers who send headers there are opera mini and bolt HTTP_X_BOLT_PHONE_UA HTTP_X_OPERAMINI_PHONE_UA I dont know others . I think only indians users come from t9space ..

ohh , I remember i changed the mysql connection type , from mysql_connect to mysql_pconnect (persistent one) . I read is good for sites with big traffic .. the persistent connection dont make a new connection each time a PHP page is called up.

yes, pconnect is better, im using it too.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #20

thats new pconnet lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close