iopietro / Travianz-Legacy

Join our Discord Server: https://discordapp.com/invite/9fbJKP9 | New repo: https://github.com/iopietro/Travianz
GNU General Public License v3.0
160 stars 95 forks source link

Question because of high MySQL queries #431

Closed agony09 closed 6 years ago

agony09 commented 6 years ago

On your home page is written: "The legacy code in this clone (which was created in 2013) is right now doing about 400 MySQL queries (questions to the database) per single page refresh - which is usually well beyond what most shared hostings can support with a big enough player base."

That would be at 10 simultaneous players already 4.000 MySQL queries (questions to the database) per single page refresh.

My questions would be:

  1. What server would be recommended for example?
  2. Would it be possible to change the program so that the MySQL queries is reduced?
martinambrus commented 6 years ago

Question 1 could be better answered by @Shadowss, he said that he was running this on a dedicated hosting even before I did optimizations and caching with hundreds of players and it worked for him.

As for question 2, I have already spent 1 month optimizing and caching what can be optimized and cached. Trust me, unless the database structure and the whole Automation script is changed, there is no way to optimize this any further. And that's why we have a Refactoring project planned here for this project.

N.B.: there was more than 1500 queries generated for each page refresh before the mentioned optimizations

agony09 commented 6 years ago

Thank you for your answer. How about the values now look after your optimization work? it is still at approx 400 MySQL queries (questions to the database) per single page refresh ?

martinambrus commented 6 years ago

As I said, I took 1500 queries to the database down to 400. So yes, that's how it is now,

agony09 commented 6 years ago

OK thanks. with the renewal of the database and automation mentioned by you. what value could you possibly achieve according to your assessment?

martinambrus commented 6 years ago

Better value. I have no numbers.