Raised This Month: $101 Target: $400
 25% 

Website is slow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnowHP
Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 07-04-2018 , 20:46   Website is slow
Reply With Quote #1

Hello everyone, on my sourcebans website: http://tug4elite.com/bans/ all the website is very slow. What can I do to increase the performance of website?
__________________
SnowHP is offline
arne1288
SourceMod Moderator
Join Date: Apr 2012
Old 07-05-2018 , 07:18   Re: Website is slow
Reply With Quote #2

1. Figure out what the issue is
2. Act on the issues there are.

Typically, you (people in general) are going for either FREE or very CHEAP hosting, which have the side effects of being very lousy in regards to performance.

Simple web hosting means that thousands of customers are often loaded on the same physical machine, which means it is probably other customers that are affecting the performance.

VPS may occasionally have the same issues, where "neighbours" are affecting the performance.

If you want to be sure on that part, you need a machine for yourself, which can handle your load. WE're here talking about dedicated servers (also known as "root servers", "bare metal", etc.).

Getting a good and local (or very close to your country) provider will quite often also help the issues, e.g. clients from Germany would have to travel very far to reach web hosting in USA or the Asia Pacific region.

Best thing here would be to take some hosting in Germany, but again, not all hosting in Germany may be good. Your own ISP could be a "low end" and lousy one, that doesn't have a very good connectivity, and in a such case, it doesn't really matter which provider you take.

And also, the same thing could be effective for your hosting (and potentially: them or their ISP).


The linked site loads very fast from my end though.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread]
arne1288 is offline
SnowHP
Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 07-07-2018 , 12:32   Re: Website is slow
Reply With Quote #3

Quote:
Originally Posted by arne1288 View Post
1. Figure out what the issue is
2. Act on the issues there are.

Typically, you (people in general) are going for either FREE or very CHEAP hosting, which have the side effects of being very lousy in regards to performance.

Simple web hosting means that thousands of customers are often loaded on the same physical machine, which means it is probably other customers that are affecting the performance.

VPS may occasionally have the same issues, where "neighbours" are affecting the performance.

If you want to be sure on that part, you need a machine for yourself, which can handle your load. WE're here talking about dedicated servers (also known as "root servers", "bare metal", etc.).

Getting a good and local (or very close to your country) provider will quite often also help the issues, e.g. clients from Germany would have to travel very far to reach web hosting in USA or the Asia Pacific region.

Best thing here would be to take some hosting in Germany, but again, not all hosting in Germany may be good. Your own ISP could be a "low end" and lousy one, that doesn't have a very good connectivity, and in a such case, it doesn't really matter which provider you take.

And also, the same thing could be effective for your hosting (and potentially: them or their ISP).


The linked site loads very fast from my end though.
The section of bans loads fast too?
__________________
SnowHP is offline
arne1288
SourceMod Moderator
Join Date: Apr 2012
Old 07-08-2018 , 08:07   Re: Website is slow
Reply With Quote #4

Quote:
Originally Posted by SnowHP View Post
The section of bans loads fast too?
In the initial post, you said the whole site (e.g. "all the website") was slow:

Quote:
Originally Posted by SnowHP View Post
http://tug4elite.com/bans/ all the website is very slow.
I was looking around without issues the other day, but as of for a couple of minutes ago, the Bans section took around probably in the area of 30-40 seconds to load the bans.

This could be caused by various different things, including, but not limited to:

- a slow machine running the SQL database.
- bad / slow and otherwise otherwise unoptimized queries

Given the fact that you have more than 12k bans, those two are likely the ones hitting you.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread]
arne1288 is offline
SnowHP
Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 07-10-2018 , 13:46   Re: Website is slow
Reply With Quote #5

Quote:
Originally Posted by arne1288 View Post
In the initial post, you said the whole site (e.g. "all the website") was slow:



I was looking around without issues the other day, but as of for a couple of minutes ago, the Bans section took around probably in the area of 30-40 seconds to load the bans.

This could be caused by various different things, including, but not limited to:

- a slow machine running the SQL database.
- bad / slow and otherwise otherwise unoptimized queries

Given the fact that you have more than 12k bans, those two are likely the ones hitting you.
Its possible to remove very old bans that have expired easly?
__________________
SnowHP is offline
Cooky
Veteran Member
Join Date: Jun 2010
Location: 127.0.0.1
Old 07-11-2018 , 03:42   Re: Website is slow
Reply With Quote #6

Quote:
Originally Posted by SnowHP View Post
Its possible to remove very old bans that have expired easly?
Jep, with some kind of query in your DB
__________________
Cooky is offline
Doulos
AlliedModders Donor
Join Date: Aug 2007
Old 07-11-2018 , 16:38   Re: Website is slow
Reply With Quote #7

Quote:
Originally Posted by SnowHP View Post
Its possible to remove very old bans that have expired easly?
If you have access to the database directly via phpmyadmin, or some other mySQL tool, use this...

DELETE FROM sb_bans WHERE created < the unix timestamp of the date you want to start deleting bans

example: To delete all bans, using a SQL query, that were created before Saturday, February 4, 2017 1:59:09 AM use:

DELETE FROM sb_bans WHERE created < 148617354

There are many online unix timestamp conversion tools.

Note: This will only delete the data from the sb_bans table, there may be other data for that player in other tables.

Last edited by Doulos; 07-11-2018 at 16:40.
Doulos is offline
SnowHP
Member
Join Date: Sep 2016
Location: Porto, Portugal
Old 07-11-2018 , 21:26   Re: Website is slow
Reply With Quote #8

Quote:
Originally Posted by Doulos View Post
If you have access to the database directly via phpmyadmin, or some other mySQL tool, use this...

DELETE FROM sb_bans WHERE created < the unix timestamp of the date you want to start deleting bans

example: To delete all bans, using a SQL query, that were created before Saturday, February 4, 2017 1:59:09 AM use:

DELETE FROM sb_bans WHERE created < 148617354

There are many online unix timestamp conversion tools.

Note: This will only delete the data from the sb_bans table, there may be other data for that player in other tables.
Will this fix the lag?
__________________
SnowHP is offline
Doulos
AlliedModders Donor
Join Date: Aug 2007
Old 07-12-2018 , 05:50   Re: Website is slow
Reply With Quote #9

If it is caused by having such a large table it should help - depending on how many of the huge number of bans you have get deleted. Many other factors go into how long it takes the query to return your data and show it on the page - such as those outlined above.

Make a backup of your database first, then delete a bunch of the bans then check to see if it makes a difference. If not you can always restore your tables.

Last edited by Doulos; 07-12-2018 at 05:53.
Doulos is offline
arne1288
SourceMod Moderator
Join Date: Apr 2012
Old 07-12-2018 , 06:56   Re: Website is slow
Reply With Quote #10

It may help, which you will only find out by trying, however, as noted above:

Quote:
Originally Posted by Doulos View Post
Note: This will only delete the data from the sb_bans table, there may be other data for that player in other tables.
Only 1/4th of the data appears to be deleted, as there are cross references in other tables:

Quote:
Originally Posted by SnowHP View Post
Its possible to remove very old bans that have expired easly?
RemoveType does (normally!) equal NULL for bans you (or other admins) haven't touched, so unless you have a heavily customized SourceBans(++) or DB, you can do the following quick-made queries:

1. DELETE FROM sb_banlog WHERE bid IN (SELECT bid FROM sb_bans WHERE RemoveType IS NOT NULL)
2. DELETE FROM sb_comments WHERE bid IN (SELECT bid FROM sb_bans WHERE RemoveType IS NOT NULL)
3. DELETE FROM sb_protests WHERE bid IN (SELECT bid FROM sb_bans WHERE RemoveType IS NOT NULL)
4. DELETE FROM sb_bans WHERE RemoveType IS NOT NULL

Be sure to run the 4th with "DELETE FROM sb_bans" as the very last one, when all the other "references" have been run and deleted.

Quote:
Originally Posted by SnowHP View Post
Will this fix the lag?
There is absolutely no guarantee.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread]
arne1288 is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 01:33.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode