background preloader

Optimization tips

Facebook Twitter

Caching Tutorial for Web Authors and Webmasters. For Web Authors and Webmasters This is an informational document. Although technical in nature, it attempts to make the concepts involved understandable and applicable in real-world situations. Because of this, some aspects of the material are simplified or omitted, for the sake of clarity. If you are interested in the minutia of the subject, please explore the References and Further Information at the end. What’s a Web Cache? A Web cache sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself.

There are two main reasons that Web caches are used: To reduce latency — Because the request is satisfied from the cache (which is closer to the client) instead of the origin server, it takes less time for it to get the representation and display it. Kinds of Web Caches Browser Caches Proxy Caches Gateway Caches. eAccelerator - Trac. 40 Tips for optimizing your php code // Reinhold Weber. 63 Best practice optimize PHP code performance. PHP Optimization Tips | ProgTuts. This tutorial will explain many small techniques which will, hopefully, help optimize your php scripts. I considered myself a bit of a PHP pro until I started researching some of this stuff and realized that there is a whole realm of information out there about optimizing php that I didn’t know about. I hope you will be as surprised as I was about some of the things you might learn from this article. Output of Data So first off lets start with outputting data to the user. Here are some handy tips to remeber: echo is faster than print (cite) When outputting strings: Single quotes (’) with concatenation is faster than putting your variables inside a double quote (”) string.

Or even better: Use echo’s multiple parameters instead of string concatenation. Loops and Counting Here are some ways to make your loops and counting a bit more efficient. Use pre-calculations and set the maximum value for your for-loops before and not in the loop. When checking the length of strings: When incrementing: And. PHP accelerator. A PHP accelerator is a PHP extension designed to improve the performance of software applications written in the PHP programming language. Operation[edit] Practical benefits[edit] PHP accelerators substantially increase the speed of PHP applications. Improvements of web page generation throughput by factors of two to seven have been observed.[1][2][3] See also[edit] List of PHP accelerators References[edit] External links[edit] Alternative PHP Cache, a widely used opcode cache.

Mise en place de zend optimizer pour php. Comment optimiser les performances d'éxécution de vos scripts php sous debian; La société zend mets à disposition leur moteur de script Zend optimizer qui optimise la manière dont sont exécutés les scripts php de votre serveur. L'efficacité de ce dernier dépendra des différents algorythmes mis en place dans vos scripts et donc très difficilement quantifiables. Il faut d'abord télécharger l'archive: Rendez-vous sur Après une inscription préalable vous aurez accès à l'archive en téléchargement. Placez l'archive dans /usr/src Décompressez là: # tar xvzf ZendOptimizer-3.2.6-linux-glibc21-i386.tar.gz # cd ZendOptimizer-3.2.6-linux-glibc21-i386 Lancer l'installation: # . Validez la licence (si vous etes d'accord avec celle-ci bien-sur) Laissez les valeurs par défaut qui sont correctes dans la majorité des cas. Une fois l'installation faite, vous pouvez vérifier que le moteur est bien actif en tapant: # php -v.

Zend Guard - Zend Optimizer Overview. Zend Guard, the most widely accepted PHP encoding and obfuscation product on the market, protects your application from unlicensed use and reverse engineering. As software vendors write more and more commercial applications in PHP it is critical that their intellectual property is protected.

With applications now providing evaluation copies and electronic downloads it can get even more complicated to ensure that they are being distributed securely, whether free, for evaluation or for commercial sale. Zend Guard protects your applications from reverse engineering and unauthorized customization by providing encoding and obfuscation. It further protects from unlicensed use and redistribution by providing comprehensive licensing support. Prevent reverse engineering through PHP encoding and obfuscation You worked hard to develop your code. Encoding is a process where the PHP source code is converted to an intermediate machine readable format.

Protect your PHP code from unauthorized use. : A HOWTO on Optimizing PHP with tips and methodologies. Last revised 30 Oct 2009. The benchmarks may be out of date, but the general advice is still good. I have revised the caching sections as 8 years of experience has shown it is the most critical part of high performance: I have added discussions of squid and memcache. If you want to see what has changed, search for this date in this article.

If you like this article, visit my blog, PHP Everywhere for related articles. A HOWTO on Optimizing PHP PHP is a very fast programming language, but there is more to optimizing PHP than just speed of code execution. In this chapter, we explain why optimizing PHP involves many factors which are not code related, and why tuning PHP requires an understanding of how PHP performs in relation to all the other subsystems on your server, and then identifying bottlenecks caused by these subsystems and fixing them. Achieving High Performance When we talk about good performance, we are not talking about how fast your PHP scripts will run. Bottlenecks (a) Networking. 12 astuces d'optimisation de performance PHP - Prendre un Caf. Les pool de connexion MySQL s.

Le Pooling consiste à entretenir les connexions ou des ressources, afin de les utiliser immédiatement lorsque la demande est faite, au lieu de reconstruire entièrement toute la ressource. C'est un sujet crucial dans les relations entre PHP et MySQL, puisque généralement, les scripts PHP établissent une connexion avec MySQL (et parfois même pour ne pas s'en servir). Un démon intermédiaire, comme SQLRelay ou les connexions persistantes, permet de garder les connexions ouvertes, et de les attribuer immédiatement au script qui en fait la demande. Cela soulage le serveur MySQL des instructions d'ouverture et de fermeture d'une connexion.

En PHP, le principe est le même : certaines informations gagneraient à être conservée en mémoire, comme certains objets ou classements. Le démon SRM avait ce projet, mais rare sont les couches de persistances en PHP. Au passage, Brian Aker nous gratifie d'un exemple d'utilisation de mysqlslap, un outil de la distribution MySQL pour tester la charge du serveur.

Andi on Web & IT: PHP and Database Connection Pooling. During my recent vacation I worked on this blog entry which talks about connection pooling in PHP and some of the recent interesting results IBM published in a recent Zend Developer Zone article. I just saw Christopher Jones’ blog entry on a new feature coming in Oracle 11g so I’ve slightly adjusted it to include the news. As is apparent from the likes of Yahoo! , Facebook and other large Web 2.0 companies who have billions of page views per month, PHP can indeed be deployed in a way which scales extremely well. Naturally with any technology that has to scale to huge volumes of traffic using large clusters of servers, there are always scalability issues that need resolving. Common issues that IT personnel deal with are monitoring and management of their clusters, application deployment, file system scalability, network topology, high availability and database scalability.

In my experience, databases have had a long history of being the typical bottleneck in PHP applications.