GPS日志插件更新
终于在两年后把gps的这个插件加上了照片导入功能。现在显示的gps轨迹已经带了照片的经纬度并显示照片。通过php读取exif信息读出经纬度然后存入数据库。
同时还需要做的就是将这个照片导入和wordpress的相册插件结合起来,另外增加一些别的功能如相册浏览,exif信息等。
下一步需要增加海拔和速度的图表,更加直观。
终于在两年后把gps的这个插件加上了照片导入功能。现在显示的gps轨迹已经带了照片的经纬度并显示照片。通过php读取exif信息读出经纬度然后存入数据库。
同时还需要做的就是将这个照片导入和wordpress的相册插件结合起来,另外增加一些别的功能如相册浏览,exif信息等。
下一步需要增加海拔和速度的图表,更加直观。
安装后我进行了测试以下为测试结果
分别开启关闭xcache 运行两次ab -n 1000 http://bbs.k12zy.com/forum-19-1.html
Server Software: nginx/0.6.33
Server Hostname: bbs.k12zy.com
Server Port: 80
Document Path: /forum-19-1.html
Document Length: 32118 bytesTime taken for tests: 38.976547 seconds
Requests per second: 25.66 [#/sec] (mean)
Time per request: 38.977 [ms] (mean)
Time per request: 38.977 [ms] (mean, across all concurrent requests)
Transfer rate: 814.16 [Kbytes/sec] receivedTime taken for tests: 17.326479 seconds
Requests per second: 57.72 [#/sec] (mean)
Time per request: 17.326 [ms] (mean)
Time per request: 17.326 [ms] (mean, across all concurrent requests)
Transfer rate: 1831.47 [Kbytes/sec] received那么apache服务器的效果如何呢,又做了测试
Server Software: Apache/2.2.3
Server Hostname: 121.250.15.4
Server Port: 80
Document Path: /forum-19-1.html
Document Length: 32116 bytesTime taken for tests: 32.138246 seconds
Requests per second: 31.12 [#/sec] (mean)
Time per request: 32.138 [ms] (mean)
Time per request: 32.138 [ms] (mean, across all concurrent requests)
Transfer rate: 988.04 [Kbytes/sec] receivedTime taken for tests: 20.6633 seconds
Requests per second: 49.98 [#/sec] (mean)
Time per request: 20.007 [ms] (mean)
Time per request: 20.007 [ms] (mean, across all concurrent requests)
Transfer rate: 1587.17 [Kbytes/sec] received
其中红色为开启xcache的值
结果来看开启xcache肯定要快,至于apache和nginx的fastcgi来比较缺让人看的不清楚, 只能解释由于第一次测试的是nginx不开xcache可能在数据库端使其变慢,都以一次测试的值也不能算作科学统计,仅做为自己的测试吧。
在服务器中安装了xcache,来加速php的运行。
关于xcache 可以查看 http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps1/
yum install php-devel
wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
tar -xvf xcache-1.2.2.tar.gz
cd xcache-1.2.2
phpize./configure –enable-xcache –enable-xcache-coverager
make
make install
得到结果:
Installing shared extensions: /usr/lib/php/modules/
将配置加入php.ini
cat xcache.ini >> /etc/php.ini
编辑php.ini 将 xcache.so的路径改为 /usr/lib/php/modules/xcache.so
重启fastcgi spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi
安装 XCache Administration
修改php.ini xcache.admin.pass=”” 为md5(“密码”)的值
复制 admin 文件夹到web目录
浏览器中浏览
启用后居然不管用原来默认配置中xcache.size和xcache.var_size都是0M 改成合适的数值就好
参考:http://www.ibm.com/developerworks/cn/opensource/os-php-fastapps1/
加入了php的支持,nginx使用的是fastcgi。
我使用的是centos5.2系统,其中已经通过yum安装了php,因为不想再自己重新编译了就采用spawn-fcgi的方式来做fastcgi,spawn-fcgi包含在lighttpd,
wget lighttpd
./configure;
make;
cp src/spawn-fcgi /usr/bin/spawn-fcgi
spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u nobody -g nobody -f /usr/bin/php-cgi
加入开机启动
nginx 配置
加入了rewrite来做永久链接
server {
listen 222.132.76.204:80;
server_name www.wangjian.info;
access_log /export/hd1/weblog/gpsview.access.log main;location / {
root /export/hd1/web/blog/;
index index.php;if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /export/hd1/web/blog$fastcgi_script_name;
include fastcgi_params;
}
}
}
OK了,经过感觉,速度好像是快了点。继续测试中。