AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceBans / SourceBans++ (https://forums.alliedmods.net/forumdisplay.php?f=152)
-   -   Website is slow (https://forums.alliedmods.net/showthread.php?t=308820)

SnowHP 07-04-2018 19:46

Website is slow
 
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?

DarkDeviL 07-05-2018 06:18

Re: Website is slow
 
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.

SnowHP 07-07-2018 11:32

Re: Website is slow
 
Quote:

Originally Posted by arne1288 (Post 2601111)
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?

DarkDeviL 07-08-2018 07:07

Re: Website is slow
 
Quote:

Originally Posted by SnowHP (Post 2601687)
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 (Post 2601061)
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.

SnowHP 07-10-2018 12:46

Re: Website is slow
 
Quote:

Originally Posted by arne1288 (Post 2601901)
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?

Cooky 07-11-2018 02:42

Re: Website is slow
 
Quote:

Originally Posted by SnowHP (Post 2602718)
Its possible to remove very old bans that have expired easly?

Jep, with some kind of query in your DB :3

Doulos 07-11-2018 15:38

Re: Website is slow
 
Quote:

Originally Posted by SnowHP (Post 2602718)
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.

SnowHP 07-11-2018 20:26

Re: Website is slow
 
Quote:

Originally Posted by Doulos (Post 2603023)
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?

Doulos 07-12-2018 04:50

Re: Website is slow
 
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.

DarkDeviL 07-12-2018 05:56

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

Quote:

Originally Posted by Doulos (Post 2603023)
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 (Post 2602718)
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 (Post 2603071)
Will this fix the lag?

There is absolutely no guarantee.


All times are GMT -4. The time now is 12:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.