G
G
Greg Popov2016-07-05 12:10:39
Yii
Greg Popov, 2016-07-05 12:10:39

How to improve the performance of a yii v.1 project?

The project was written by Indians in the literal sense of the word, it eats up resources like a tank, how to quickly optimize all this?
Made by:
apache gzip,
css/js minification
Plans to cover all memcahed, any corrections/suggestions/corrections?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Natarov, 2016-07-05
@HanDroid

1) Put a debugger
2) see what's eating the res.
3) pull relays with eager loading, not foreach
4) Transfer complex queries to QB or Raw Query
5) You can look and cut off unnecessary logging.
Ps I hate projects from Indians. Controllers of 1250 lines KARL! The dock contains a minimum of lines in the controllers, no... Let's cram the whole site into one controller!

A
Andrey Pavlenko, 2016-07-05
@Akdmeh

The inclusion of show mysql slow query helped me a lot of my time. First put "requests longer than 3 seconds", then "2 seconds", etc. up to half a second.
Notice where the right indexes are missing, etc.
Then, even if the indexes don't help, we install memcache and cache the rest so that heavy queries are used as little as possible.
If all the same brakes - memcache on parts of pages and widgets.
Then see if Yii1 works under PHP 7 (I don't remember this moment) and if possible - translate the script to nGinx+PHP-FPM.
Then, if possible, we look at the database and make a partition by date, if there are problems with this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question