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
Before writing this article, I have also deliberately made some exchanges with my former colleagues, thanks to Sina Xiangdong, Kingsoft Zhangyan and Yahoo Luke. In addition, there are a number of online friends to my last section of the article
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
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 "
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
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
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
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
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
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
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
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,
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.
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
After the last analysis of the work done in V 0.7, began to refine the implementation of the details, because the technical details and the previous thought of a little different, in the refinement at the same time also slightly adjusted, the system
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.