This article mainly introduces the PHP code optimization 53 details, common and important PHP optimization strategy, need friends can refer to the following
It is quicker to use single quotes instead of double quotes to contain strings. Because PHP
PHP is a scripting language executed on the server side that has developed many of the world's best-known websites, including Yahoo and Facebook. Here are 6 PHP code, performance tuning tips.
1. Upgrade PHP to the latest version
The easiest way to
A memcache overview
Memcached is a distributed cache system developed by LiveJournal's Brad Fitzpatrick, but is currently used by many Web sites. This is a set of open source code, released with BSD license authorization. Software is a
1.memcached_inc.sh
Sets the path, port, and other messages.
#!/bin/sh
#config include
host=$ (hostname)
site= "MySite"
port=11211
memcached_pid_file= "/ Tmp/memcached.pid "
After learning about the world's largest PHP site, Facebook's back-end technology, today we'll look at a millions PHP site's web architecture: poppen.de. Poppen.de, a social networking site in Germany, is a small web site relative to Facebook and
The project has been done a lot, although there are a lot of projects with memcached. But I didn't pay much attention to installation memcached details.
Recently done a project, put a lot of things into the memcached cache, for caching.
Because
One, storage command
Store the format of the command:
?
1 2
The parameter description is as follows:
Set/add/replace
Find keywords
The client uses it to store
The client supports a variety of languages, many of which are connected to memcached clients, with Perl and PHP as the main. Only the language listed on the memcached website has
Perl
Php
Python
Ruby
C#
C + +
Lua
Java
The following author
phpize is used to extend the PHP extension module, through the phpize can build PHP plug-in module, the following describes a method of his use, the need for friends can refer to the following When installing (fastcgi mode), there is often such a
Project on the home page to see a article PHP to do the pros and cons of Web projects, their own also to nonsense a few words.
In fact, PHP is a very good tool, it can be simple, but also can be complex. Different items should be used in a different
PHP is a very good tool, it can be simple, but also can be complex. Different items should be used in a different PHP.
Small items-simple and straightforward PHP
Generally for a functional page under 20 of the site, we can use a very simple frame
What ' s memcached?
Memcached is a caching system that caches data in a key-value form. Increase the speed of data acquisition by caching data into memory.
Memcached to save the data in the form of Key-value, you can associate a key for each piece
Recently webmaster I also learn php, so tidy up some of the PHP development of small tips for everyone to learn.
0. It is quicker to use single quotes instead of double quotes to contain strings. Because PHP searches for variables in a string
Done in the project hibernate are directly using Ehcache as a cache, Ehcache is a good thing, the use of memory + file system can be qualified for most of the situation, and Hibernate and Ehcache is a perfect match, with a very tacit understanding.
connect ("Memcached_ip", Memcached_port); Save the data $mem->set (' The key name used to store the value.
', ' stored value ', ' Expiration Time ');
$val = $mem->get (' Key name used to store values '); echo "Get is used to
This is Fotolog's experience, the legendary site more than Flickr, Fotolog deployed 51 memcached instances on 21 servers, a total of 254G cache space available, cache up to 175G of content, this number is much larger than the database of many sites,
Brief introduction
There are currently 3 Java clients in common use.
Memcachedclient
Spymemcached
Xmemcached
Memcachedclient: The author of the test, in high concurrency, easy to report abnormal, out of the Memory.
Spy: Performance is slightly
In many occasions, we will hear the name memcached, but many students just heard, and did not use or actually understand, only know it is a very good stuff. Here is a brief introduction, memcached is an efficient and fast distributed memory object
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.