Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader
Reply
  #1  
Old 8th January 2018, 16:54
Tumo Tumo is offline
Member
 
Join Date: Jan 2018
Posts: 2
Unhappy MySQL databse optimisation in torrenttrader script
Hi for some reason one of my site (which use torrentrader script) has some issue with mysql databse ,mysql usage goes upto 500-800% , I couldnt figure it out what to do to fix/optimize the database

so pls help me thanks in advance
Reply With Quote
  #2  
Old 8th January 2018, 17:48
l3on l3on is offline
Coder
 
Join Date: Jul 2012
Posts: 154
Default
Please provide more information like witch mods you use and how many members?
Reply With Quote
The Following User Says Thank You to l3on For This Useful Post:
Tumo (8th January 2018)
  #3  
Old 8th January 2018, 18:15
Tumo Tumo is offline
Member
 
Join Date: Jan 2018
Posts: 2
Default
Quote:
Originally Posted by l3on View Post
Please provide more information like witch mods you use and how many members?
DM sent :)
Reply With Quote
  #4  
Old 8th January 2018, 18:19
l3on l3on is offline
Coder
 
Join Date: Jul 2012
Posts: 154
Default
I've read your message again this provide nothing we need to know each mod you have install etc
And your server specs.
Reply With Quote
  #5  
Old 8th January 2018, 19:19
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
Default
of course it goes up to 800% if you didnt configured the mysql server properly and if you dont have your sql tables also proper configured
start from here:
1. configure your mysql server. dont expect someone to just give you the right answer because there isnt. each problem depends on the situation
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #6  
Old 8th January 2018, 19:49
darkalchemy darkalchemy is offline
Administrator
 
Join Date: Dec 2017
United States
Posts: 101
Default
There is no easy fix.

But, you can start by logging slow queries and then use a tool to analyze it. Find out what queries are bringing the server down.

Use tools like mysql tuner to analyze mysql and tweak the config. You should only make one change at a time. One per day is a good rule of thumb.

There is much more you can do, such as caching the results, optimize the queries, remove unnecessary joins, etc.

These are just a few things I can think of off the top of my head.
Reply With Quote
The Following 2 Users Say Thank You to darkalchemy For This Useful Post:
HDVinnie (9th January 2018), papad (8th January 2018)
  #7  
Old 9th January 2018, 05:45
HDVinnie's Avatar
HDVinnie HDVinnie is offline
BluCrew
 
Join Date: Dec 2014
P2P
Posts: 140
Default
logging slow queries

This 100%! It could be something as simple as a table with so many records that when to many users access that query at same time it can cause timeouts.
Reply With Quote
  #8  
Old 11th January 2018, 03:30
ArcticWolf ArcticWolf is offline
Senior Member
 
Join Date: Oct 2008
Posts: 41
Default
Most of the time high cpu usage is wrong or missing indexes.
Best bet is to check the tables in question to make sure has indexes
Without knowing your exact query causing the lag its hard to say what your indexes should be.

Also I would try changing well used tables or really large tables from MyISAM to InnoDB because InnoDB dont lock the table in slow querys.
Ones I would do without looking at the db is users,torrents,files,comments,
Reply With Quote
  #9  
Old 13th January 2018, 11:54
LeeHowarth LeeHowarth is offline
TT
 
Join Date: Nov 2008
Posts: 100
Default
If you have alot of RAM then use MEMORY storage engine for peers, guests tables, and INNODB for users, torrents.

With abit of traffic your site will become heavilly overloaded, the main problem is the scrape/announce requests.

In the past i did some experimental work with adding caching in the announce/scrape and it helped alot.
Reply With Quote
Reply

Tags
databse , mysql , optimisation , script , torrenttrader

Thread Tools

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 +2. The time now is 21:46. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.