by jay patel
Known fact that page loading speed is an essential factor for any site. Users are not willing to wait for long pages response and in the worst cases they can leave your site. Search Engines reduce page rank of your site when the speed is too slow; this results in fewer visitors from Search Engines.
And, yes, as the site administrator you’ll feel irritation, if you have to wait a long time while managing your site, knowing that this process can be accelerated. All the ways to speed up your site are divided into two basic methods: website software optimization and server software/hardware optimization.
Recently Advance Idea Infotech PHP department developed several highly loaded PHP based websites and we want to share some techniques that allowed us to speed up sites, developed using the following languages/technologies/tools: PHP, MySQL Percona Server, JavaScript HTML5, CSS3, Apache, Nginx, FastCGI, APC. Using the outlined methods in this article, you’ll be able to speed up your PHP-based website quickly and effectively regardless of its platform (Yii, Symphony, Drupal, Joomla or any other – it doesn’t matter).
Long processing of database queries is often the cause of slow pages loading. Often the reason for this is incorrectness of queries writing, lack of competent tables indexing, bulky and too complex requests and etc. At this stage it is necessary to catch all requests that carried out more than 2 seconds and directed to database more often.
You can handle with too long requests by using correct index settings in tables and writing less bulky requests with all recommended SQL rules.
System caching data received from the database is the most effective way for most repeated queries. It works as follows - if one of the visitors sent the query to database which returns some data then this info will be taken from the cache if the same query will be done even from the other user. Thereby the load on the database is decreasing and the page load time increases.
You can often notice slideshow elements on the main page of websites, where you find 5-7 images, 300KB each. As a result, we got somewhere around 2MB, which are downloaded from the server to user's browser.
Also, if the website is a shop and contains more than a thousand of products, and each of these products has 2-3 pictures (200-300Kb) on page, then all of the images need full load time, which ultimately increases pages load time.
IN THIS CASE I PROPOSE:
After these procedures, it is desirable to use one of the data caching systems. This allows to store the received data from server in browser cache for some time. This method allows not taking data from server after reloaded page and using cached data from your browser. It also reduces servers’ load and reduces page load time.
In fact, it is one of the most important methods and maybe one of the most labor-intensive. Initially correctly built system foundation gives reliability, faultiness and speed of operations. Every developer knows about it, but often neglects this approach.
The developers should initially use object-oriented programming paradigm to obey Model-View-Controller and etc., since it becomes truisms for most modern web-development software. In this early stage of software architecture any errors would entail substantial labor costs in future.
"Experts in Advance Idea Infotech Company have broad experience in developing fault-tolerant source code, which flexibly scaled and modified for the unique requirements of any customer. At the same time, software speed remains fast and customer retains its ability to improve the system without system redeveloping from scratch."
We want to mention fast methods of source code optimization, which gives the results in a short period of time:
This method is used when you have on page:
Often, such JavaScript is loaded before the main visual elements on page and main visual elements are not showing till JavaScript finishes its work. Since JavaScript takes some time to load not a significant visual content, it might seem that whole page is loading slowly.
IN SUCH CASES YOU NEED TO USE ASYNCHRONOUS JAVASCRIPT LOADING:
As a result, we receive a user-friendly page as almost all content on the page will be shown without delay for the end user.
In order to detect such errors use online W3C-Validator, which analyzes any site, indicates such errors and explains what kind of mistake is this and how to fix it. This method allows you quickly remove obvious errors and thus in most cases it helps to speed up the process of page loading. It also helps search engines to be more loyal to your website, which means the increase of site rating.
If you load a page with a certain category products, then similar products and images will be displayed in this list. For example, you display 20-40 goods on pagination list, which means that the exact numbers of images are loading too. In most cases, page visitor cannot see all of the 20-40 items at the same time. To view them all, he needs to use the mouse scrolling. It follows that the initial loading of 20-40 images takes a lot of time. And the visitor is bored to wait until these 20-40 pictures will be loaded on page.
POSSIBLE SOLUTIONS:
As a result, this method allows you to download partly data on page, according to users’ needs, reducing the load on server and free up system resources to use on other tasks.
This gives enormous increase of performance, which helps to reduce the time for inquiry process more effectively. With simultaneous use of Nginx and Apache, it is possible to divide the load between two systems.
Percona Server is a replacement for standard MySQL. Percona stands out for improved performance and scalability. Advanced functionality allows you to gather various statistics, analyze the problems and find optimal solutions. Percona is free; it also allows accelerating the inquiry process in database for a short period of time, thereby to reduce page load time.
Configure this interface on the side of the server increases the speed of the executable scripts.
After installation it allows to cache executable PHP scripts, which also reduces load on web server and decrease page load time.
There is a history log created on server after all system manipulations and if someone is making changes to the system. This history is accumulated in logs: FTP logs, MySQL logs, web server logs, SMTP server logs and etc.
In fact, any software installed on the server can create a list of such logs. But all of these logs are extremely important, as in case of any system failures or unauthorized access by third parties, system administrator will always be able to understand causes and recover system. Logs constantly reduce servers’ disk space that could lead to unpredictable expenses on additional free disk space.
Also server creates a special system file (paging file) that is filled during peak hours, when RAM is not enough for server to handle all requests. This system file is always reserve several GB of disk space and can be increased «on fly». So if logs "eat up" the remnants of disk space, the system file cannot increase and as a result the site is very slow, and sometimes it even freezes.
There is only one way out except buying a lot of disk space:
If you have used all of the methods above and still want to speed up site response you should update servers’ hardware:
All of these options (or combinations) will also have a positive impact on site responsiveness and will allow to sustain at least ten thousands visitors at the same day.
Your email address will not be published. Required fields are marked *