phpmyadmin是个很方便的mysql数据库管理工具,可以用来管理mysql数据库,导入,导出等。 phpmyadmin在导入mysql的时候有个问题,如果要导入的数据库文件比较大,那么导入就会失败。下面介绍一个方法,可以导入任意大小的mysql数据库,步骤如下: 1. 通过FTP把数据库的SQL文件上传到网站的根目录下 2. 在网站的根目录下,创建文件import.php,该文件的内容见文章末尾 3. 在浏览器里面访问这个import.php,假设你的网站域名是www.a.com,那么就在浏览器里面访问 http://www.a.com/import.php , 只要浏览器一开始访问这个import.php文件,数据就开始导入了 4. 数据导入结束后,屏幕上会出现”import ok”的字样 import.php文件的内容如下: < ? system("mysql -uroot -pmypassword database < a.sql"); print "import ok"; ?> 其中root表示数据库用户名,mypassword表示root的密码,database表示要导入的数据库的名字,a.sql表示数据库文件的文件名,该文件是解压缩后的文件。这几个变量可以根据实际情况修改。
phpmyadmin是个很方便的mysql数据库管理工具,可以用来管理mysql数据库,导入,导出等。
phpmyadmin在导入mysql的时候有个问题,如果要导入的数据库文件比较大,那么导入就会失败。下面介绍一个方法,可以导入任意大小的mysql数据库,步骤如下:
1. 通过FTP把数据库的SQL文件上传到网站的根目录下
2. 在网站的根目录下,创建文件import.php,该文件的内容见文章末尾
3. 在浏览器里面访问这个import.php,假设你的网站域名是www.a.com,那么就在浏览器里面访问 http://www.a.com/import.php , 只要浏览器一开始访问这个import.php文件,数据就开始导入了
4. 数据导入结束后,屏幕上会出现”import ok”的字样
import.php文件的内容如下:
< ?
system("mysql -uroot -pmypassword database < a.sql");
print "import ok";
?>
其中root表示数据库用户名,mypassword表示root的密码,database表示要导入的数据库的名字,a.sql表示数据库文件的文件名,该文件是解压缩后的文件。这几个变量可以根据实际情况修改。
VPS(全称Virtual Private Server)是利用最新虚拟化技术在一台物理服务器上创建多个相互隔离的虚拟私有主机。它们以最大化的效率共享硬件、软件许可证以及管理资源。 对其用户和应用程序来讲,每一个VPS平台的运行和管理都与一台独立主机完全相同,因为每一个VPS均可独立进行重启并拥有自己的root访问权限、用户、IP地址、内存、过程、文件、应用程序、系统函数库以及配置文件。 VPS服务器最重要的指标就是内存大小,多个VPS服务器可以共享一颗CPU,但不能共享同一块内存。内存越大,价格越贵。 下面,以我的博客所在的VPS为例,介绍在128M内存下对 Nginx 0.7.x + PHP 5.2.6(FastCGI)+ MySQL 5.1 的优化。 至于 Nginx + PHP + MySQL 的安装配置,可参见:《Nginx 0.7.x + PHP 5.2.6(FastCGI)搭建胜过Apache十倍的Web服务器(第4版) 》 ——————————————————————————– 优化后的效果: 提供HTTP服务的1个Nginx进程占用11M物理内存,5个php-cgi进程每个占用8M左右物理内存,1个MySQL服务器占用7M物理内存,加上两个占用内存不大的Nginx和php-cgi父进程,Nginx + PHP + MySQL 系列总共只占用47.7%的物理内存,即62M物理内存(128M * 47.7% ≈ 62M)。 另外,VPS服务器系统自身和其它程序也会使用一些内存,但128M内存的VPS已经够用。总体而言,经过优化后,128M内存的VPS跑 Nginx + PHP + MySQL 效果不错。当然,如果有Money购买更大内存的VPS,就更好了。 优化项如下: 一、增加256M的swap交换文件 1、创建并激活swap交换文件 cd /var/ dd if=/dev/zero of=swapfile bs=1024 [...]
VPS(全称Virtual Private Server)是利用最新虚拟化技术在一台物理服务器上创建多个相互隔离的虚拟私有主机。它们以最大化的效率共享硬件、软件许可证以及管理资源。
对其用户和应用程序来讲,每一个VPS平台的运行和管理都与一台独立主机完全相同,因为每一个VPS均可独立进行重启并拥有自己的root访问权限、用户、IP地址、内存、过程、文件、应用程序、系统函数库以及配置文件。
VPS服务器最重要的指标就是内存大小,多个VPS服务器可以共享一颗CPU,但不能共享同一块内存。内存越大,价格越贵。
下面,以我的博客所在的VPS为例,介绍在128M内存下对 Nginx 0.7.x + PHP 5.2.6(FastCGI)+ MySQL 5.1 的优化。
至于 Nginx + PHP + MySQL 的安装配置,可参见:《Nginx 0.7.x + PHP 5.2.6(FastCGI)搭建胜过Apache十倍的Web服务器(第4版) 》
——————————————————————————–
优化后的效果:
提供HTTP服务的1个Nginx进程占用11M物理内存,5个php-cgi进程每个占用8M左右物理内存,1个MySQL服务器占用7M物理内存,加上两个占用内存不大的Nginx和php-cgi父进程,Nginx + PHP + MySQL 系列总共只占用47.7%的物理内存,即62M物理内存(128M * 47.7% ≈ 62M)。
另外,VPS服务器系统自身和其它程序也会使用一些内存,但128M内存的VPS已经够用。总体而言,经过优化后,128M内存的VPS跑 Nginx + PHP + MySQL 效果不错。当然,如果有Money购买更大内存的VPS,就更好了。
优化项如下:
一、增加256M的swap交换文件
1、创建并激活swap交换文件
cd /var/
dd if=/dev/zero of=swapfile bs=1024 count=262144
/sbin/mkswap swapfile
/sbin/swapon swapfile
2、加到fstab文件中让系统引导时自动启动
vi /etc/fstab
在末尾增加以下内容:
引用
/var/swapfile swap swap defaults 0 0
详见:
——————————————————————————–
二、Nginx 0.7.19 的主配置文件(nginx.conf)优化
复制代码 代码如下:
user www www;
#Nginx每个进程耗费10M~12M内存,这里只开启一个Nginx进程,节省内存。
worker_processes 1;
error_log /data1/logs/nginx_error.log crit;
pid /usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
#charset gb2312;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
#对网页文件、CSS、JS、XML等启动gzip压缩,减少数据传输量,提高访问速度。
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zone crawler $binary_remote_addr 10m;
server
{
listen 80;
server_name blog.s135.com www.s135.com s135.com *.s135.com;
index index.html index.htm index.php;
root /data0/htdocs/blog;
#limit_conn crawler 20;
#针对Bo-Blog系统的Rewrite静态化
rewrite ^/post/([0-9]+).htm$ /read.php?$1 last;
rewrite ^/post/([0-9]+)_([0-9]+).htm$ /read.php?$1&page=$2 last;
rewrite ^/post/([0-9]+)_([0-9]+)_([0-9]+).htm$ /read.php?$1&page=$2&part=$3 last;
rewrite ^/index_([0-9]+)_([0-9]+).htm$ /index.php?mode=$1&page=$2 last;
rewrite ^/star_([0-9]+)_([0-9]+).htm$ /star.php?mode=$1&page=$2 last;
rewrite ^/category_([0-9]+).htm$ /index.php?go=category_$1 last;
rewrite ^/category_([0-9]+)_([0-9]+)_([0-9]+).htm$ /index.php?go=category_$1&mode=$2&page=$3 last;
rewrite ^/archive_([0-9]+)_([0-9]+).htm$ /index.php?go=archive&cm=$1&cy=$2 last;
rewrite ^/archive_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).htm$ /index.php?go=archive&cm=$1&cy=$2&mode=$3&page=$4 last;
rewrite ^/showday_([0-9]+)_([0-9]+)_([0-9]+).htm$ /index.php?go=showday_$1-$2-$3 last;
rewrite ^/showday_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).htm$ /index.php?go=showday_$1-$2-$3&mode=$4&page=$5 last;
location ~ .*\.(php|php5)?$
{
#将Nginx与FastCGI的通信方式由TCP改为Unix Socket。TCP在高并发访问下比Unix Socket稳定,但Unix Socket速度要比TCP快。
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ /read.php
{
#将Nginx与FastCGI的通信方式由TCP改为Unix Socket。TCP在高并发访问下比Unix Socket稳定,但Unix Socket速度要比TCP快。
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
#博客的图片较多,更改较少,将它们在浏览器本地缓存15天,可以提高下次打开我博客的页面加载速度。
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 15d;
}
#博客会加载很多JavaScript、CSS,将它们在浏览器本地缓存1天,访问者在看完一篇文章或一页后,再看另一篇文件或另一页的内容,无需从服务器再次下载相同的JavaScript、CSS,提高了页面显示速度。
location ~ .*\.(js|css)?$
{
expires 1d;
}
log_format access ‘$remote_addr – $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” $http_x_forwarded_for’;
access_log /data1/logs/access.log access;
}
}
三、PHP 5.2.6(FastCGI)的配置优化
1、php.ini 配置文件中关于eAcelerator的优化。只使用1M共享内存,删除所有在最后3600秒内无法存取的脚本缓存,用磁盘辅助进行缓存。
复制代码 代码如下:
[eaccelerator]
zend_extension=”/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so”
eaccelerator.shm_size=”1″
eaccelerator.cache_dir=”/usr/local/webserver/eaccelerator_cache”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”3600″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.keys = “disk_only”
eaccelerator.sessions = “disk_only”
eaccelerator.content = “disk_only”
2、php-fpm.conf 的配置优化
修改两项,一是修改以下一行,将启动的php-cgi进程数由原来的128个改为5个:
引用
二是修改以下一行,将TCP模式改为Unix Socket模式:
引用
——————————————————————————–
四、MySQL 5.1.26 配置优化
1、使用以下参数编译安装的 MySQL 5.1 默认支持4种存储引擎:CSV、MRG_MYISAM、MEMORY、MyISAM,不支持InnoDB存储引擎。由于内存有限,而InnoDB耗费的内存较大,这里推荐使用MyISAM存储引擎。
./configure –prefix=/usr/local/webserver/mysql/ –enable-assembler –with-extra-charsets=complex –enable-thread-safe-client –with-big-tables –with-readline –with-ssl –with-embedded-server –enable-local-infile
make && make install
2、MySQL 5.1 配置文件(my.cnf)优化
复制代码 代码如下:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysql]
prompt=”(\u:s135:)[\d]> ”
no-auto-rehash
[mysqld]
user = mysql
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/webserver/mysql
datadir = /usr/local/webserver/mysql/data
open_files_limit = 600
back_log = 20
max_connections = 100
max_connect_errors = 200
table_cache = 60
external-locking = FALSE
max_allowed_packet = 16M
sort_buffer_size = 128K
join_buffer_size = 128K
thread_cache_size = 10
thread_concurrency = 8
query_cache_size = 0M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default_table_type = MyISAM
thread_stack = 192K
transaction_isolation = READ-UNCOMMITTED
tmp_table_size = 512K
max_heap_table_size = 32M
/usr/local/webserver/mysql/data/slow.log
/usr/local/webserver/mysql/data/error.log
long_query_time = 1
log_long_format
server-id = 1
#log-bin = /usr/local/mysql/data/binlog
binlog_cache_size = 2M
max_binlog_cache_size = 4M
max_binlog_size = 512M
expire_logs_days = 7
key_buffer_size = 4M
read_buffer_size = 1M
read_rnd_buffer_size = 2M
bulk_insert_buffer_size = 2M
myisam_sort_buffer_size = 4M
myisam_max_sort_file_size = 10G
myisam_max_extra_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
[mysqldump]
quick
max_allowed_packet = 16M
user nobody nobody;
#启动进程
worker_processes 2;
#全局错误日志及PID文件
error_log logs/error.log notice;
pid logs/nginx.pid;
#工作模式及连接数上限
events {
use epoll;
worker_connections 1024;
}
#设定http服务器,利用它的反向代理功能提供负载均衡支持
http {
#设定mime类型
include conf/mime.types;
default_type application/octet-stream;
#设定日志格式
log_format main ‘$remote_addr – $remote_user [$time_local] ‘
‘”$request” $status $bytes_sent ‘
‘”$http_referer” “$http_user_agent” ‘
‘”$gzip_ratio”‘;
log_format download ‘$remote_addr – $remote_user [$time_local] ‘
‘”$request” $status $bytes_sent ‘
‘”$http_referer” “$http_user_agent” ‘
‘”$http_range” “$sent_http_content_range”‘;
#设定请求缓冲
client_header_buffer_size 1k;
large_client_header_buffers 4 4k;
#开启gzip模块
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
output_buffers 1 32k;
postpone_output 1460;
#设定access log
access_log logs/access.log main;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
#设定负载均衡的服务器列表
upstream mysvr {
#weigth参数表示权值,权值越高被分配到的几率越大
#本机上的Squid开启3128端口
server 192.168.8.1:3128 weight=5;
server 192.168.8.2:80 weight=1;
server 192.168.8.3:80 weight=6;
}
#设定虚拟主机
server {
listen 80;
server_name 192.168.8.1 www.yejr.com;
charset gb2312;
#设定本虚拟主机的访问日志
access_log logs/www.yejr.com.access.log main;
#如果访问 /img/*, /js/*, /css/* 资源,则直接取本地文件,不通过squid
#如果这些文件较多,不推荐这种方式,因为通过squid的缓存效果更好
location ~ ^/(img|js|css)/ {
root /data3/Html;
expires 24h;
}
#对 “/” 启用负载均衡
location / {
proxy_pass http://mysvr;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
#设定查看Nginx状态的地址
location /NginxStatus {
stub_status on;
access_log on;
auth_basic “NginxStatus”;
auth_basic_user_file conf/htpasswd;
}
}
}
备注:conf/htpasswd 文件的内容用 apache 提供的 htpasswd 工具来产生即可,内容大致如下:
3.) 查看 Nginx 运行状态
输入地址 http://192.168.8.1/NginxStatus/,输入验证帐号密码,即可看到类似如下内容:
Active connections: 328
server accepts handled requests
9309 8982 28890
Reading: 1 Writing: 3 Waiting: 324
第一行表示目前活跃的连接数
第三行的第三个数字表示Nginx运行到当前时间接受到的总请求数,如果快达到了上限,就需要加大上限值了。
第四行是Nginx的队列状态
问:为什么服务器在连续运行多天后或访问峰值后,进程中的一个Apache.exe占用内存几百兆不减少? 答:用记事本打开apache2\conf\httpd.conf, 我在centos5上装了kloxo,找了半天 httpd.conf在 /etc/httpd/conf/目录下。 查找MaxRequestsPerChild,将MaxRequestsPerChild 0改成MaxRequestsPerChild 50即可。 影响apache性能的几个重要参数(conf/httpd.conf中设置) KeepAlive 是否允许持续连接 MaxKeepAliveRequests 允许的持续连接的最大数 KeepAliveTimeout 持续连接在没有请求多少秒后切断 StartServers 最初启动时启动多少个服务器进程 MinSpareServers 空闲服务器进程的最小数 MaxSpareServers 空闲服务器进程的最大数 MaxClients 同时处理的请求数(最重要的参数,要少于ServerLimit) MaxRequestsPerChild 每个子进程处理的最大请求数 它们之前的关系: prefork控制进程在最初建立“StartServers”个子进程后,为了满足MinSpareServers设置的需要创建一个进程,等待一秒钟,继续创建两个,再等待一秒钟,继续创建四个……如此按指数级增加创建的进程数,最多达到每秒32个,直到满足MinSpareServers设置的值为止。这种模式可以不必在请求到来时再产生新的进程,从而减小了系统开销以增加性能。MaxSpareServers设置了最大的空闲进程数,如果空闲进程数大于这个值,Apache会自动kill掉一些多余进程。这个值不要设得过大,但如果设的值比MinSpareServers小,Apache会自动把其调整为MinSpareServers+1。如果站点负载较大,可考虑同时加大MinSpareServers和 MaxSpareServers。MaxRequestsPerChild设置的是每个子进程可处理的请求数。每个子进程在处理了 “MaxRequestsPerChild”个请求后将自动销毁。0意味着无限,即子进程永不销毁。虽然缺省设为0可以使每个子进程处理更多的请求,但如果设成非零值也有两点重要的好处:1、可防止意外的内存泄漏。2、在服务器负载下降的时侯会自动减少子进程数。 ServerLimit 2000 StartServers 10 MinSpareServers 10 MaxSpareServers 15 MaxClients 1000 MaxRequestsPerChild 2048 调试过程中用到的指令: # ps -ef|grep http|wc -l //查看请求总数 # cat /proc/loadavg //查看平均负载(loadavg),loadavg高于1,表明任务队列出现了等待,CPU忙不过来了。超过2以上就会明显感到性能降低了 # netstat -ant | grep :80 [...]
问:为什么服务器在连续运行多天后或访问峰值后,进程中的一个Apache.exe占用内存几百兆不减少?
答:用记事本打开apache2\conf\httpd.conf,
我在centos5上装了kloxo,找了半天 httpd.conf在 /etc/httpd/conf/目录下。
查找MaxRequestsPerChild,将MaxRequestsPerChild 0改成MaxRequestsPerChild 50即可。
影响apache性能的几个重要参数(conf/httpd.conf中设置)
KeepAlive 是否允许持续连接
MaxKeepAliveRequests 允许的持续连接的最大数
KeepAliveTimeout 持续连接在没有请求多少秒后切断
StartServers 最初启动时启动多少个服务器进程
MinSpareServers 空闲服务器进程的最小数
MaxSpareServers 空闲服务器进程的最大数
MaxClients 同时处理的请求数(最重要的参数,要少于ServerLimit)
MaxRequestsPerChild 每个子进程处理的最大请求数
它们之前的关系:
prefork控制进程在最初建立“StartServers”个子进程后,为了满足MinSpareServers设置的需要创建一个进程,等待一秒钟,继续创建两个,再等待一秒钟,继续创建四个……如此按指数级增加创建的进程数,最多达到每秒32个,直到满足MinSpareServers设置的值为止。这种模式可以不必在请求到来时再产生新的进程,从而减小了系统开销以增加性能。MaxSpareServers设置了最大的空闲进程数,如果空闲进程数大于这个值,Apache会自动kill掉一些多余进程。这个值不要设得过大,但如果设的值比MinSpareServers小,Apache会自动把其调整为MinSpareServers+1。如果站点负载较大,可考虑同时加大MinSpareServers和 MaxSpareServers。MaxRequestsPerChild设置的是每个子进程可处理的请求数。每个子进程在处理了 “MaxRequestsPerChild”个请求后将自动销毁。0意味着无限,即子进程永不销毁。虽然缺省设为0可以使每个子进程处理更多的请求,但如果设成非零值也有两点重要的好处:1、可防止意外的内存泄漏。2、在服务器负载下降的时侯会自动减少子进程数。
ServerLimit 2000
StartServers 10
MinSpareServers 10
MaxSpareServers 15
MaxClients 1000
MaxRequestsPerChild 2048
调试过程中用到的指令:
# ps -ef|grep http|wc -l //查看请求总数
# cat /proc/loadavg //查看平均负载(loadavg),loadavg高于1,表明任务队列出现了等待,CPU忙不过来了。超过2以上就会明显感到性能降低了
# netstat -ant | grep :80 | wc -l //查看TCP连接数
# top //查看系统运行情况
====================================================================
apache的内存使用
apache进程在使用内存时,是“渐长”的。也就是说,直到这个进程死掉,使用内存的数量是一直增长而不会减少的。这样的话,apache进程使用内存的多少,就决定于你的应用程序最大使用内存量了。
keepalive参数
KeepAliveTimeout 这个参数决定了,在什么都不做之前,一个http进程能够等待多长时间?设想一下,如果keepalive设置为on,而 keepalivetimeout设置为一个比较大的数字,apache占用内存会很快的增长。这是因为,一个apache进程完成了一个任务(并达到了一定的内存占用,想一下“渐进”模式),并不会马上退出,而是等待一个keepalivetimeout时间。假设用户的链接请求持续不断的到来,则积累起来的无用的apache进程就会相当多,直到timeout,这些进程才会被杀死。
但是,keepalive的确对于静态的文件,比如图像文件的传送是很有效的,因此,keepalive要设置为on,(off)但是keepalvietimeout要设置的小些,比如5s 15
MaxRequestsPerChild
这个参数是说,apache进程在处理了多少个请求之后,必须退出,重新开始,以免在处理中的内存问题。
对于php脚本来说,把这个参数设置的小一些是有好处的,可以避免程序使用的内存持续增长对apache带来的压力:让这个参数定期释放内存,因为php是在脚本执行完毕后,自动释放只用的资源(内存)的。
比如设置为50?如果太小的话,重新产生一个apache进程也是要消耗资源的,这是一个平衡问题。
很多小的vps,内存最小的只有64M,而这样的vps想跑WordPress ,如果不做相关的优化的话,还是有点问题的,就拿mysql来说,默认情况下,占用内存超过100M,优化后,内存占用仅10m左右,性能嘛,对于小的博客来说,足够了哦! 本人的博客就是在vps上面的。 在网上找了个牛人写的mysql优化后的配置文件,下载后,直接覆盖默认的配置文件即可。 优化前,默认配置,内存占用 total used free shared buffers cached Mem: 276480 142508 133972 0 0 0 -/+ buffers/cache: 142508 133972 Swap: 0 0 0 优化后内存占用 total used free shared buffers cached Mem: 276480 15560 260920 0 0 0 -/+ buffers/cache: 15560 260920 Swap: 0 0 0 可以明显的看出,内存使用从 142508减少到15560了,这就是结果。 脚本下载地址: http://www.unxmail.com/wp-content/uploads/2009/07/my-lxadmin-centos.cnf 下载后,更改名字为my.cnf .覆盖 /etc/my.cnf [...]
很多小的vps,内存最小的只有64M,而这样的vps想跑WordPress ,如果不做相关的优化的话,还是有点问题的,就拿mysql来说,默认情况下,占用内存超过100M,优化后,内存占用仅10m左右,性能嘛,对于小的博客来说,足够了哦!
本人的博客就是在vps上面的。
在网上找了个牛人写的mysql优化后的配置文件,下载后,直接覆盖默认的配置文件即可。
优化前,默认配置,内存占用
total used free shared buffers cached
Mem: 276480 142508 133972 0 0 0
-/+ buffers/cache: 142508 133972
Swap: 0 0 0
优化后内存占用
total used free shared buffers cached
Mem: 276480 15560 260920 0 0 0
-/+ buffers/cache: 15560 260920
Swap: 0 0 0
可以明显的看出,内存使用从 142508减少到15560了,这就是结果。
脚本下载地址:
http://www.unxmail.com/wp-content/uploads/2009/07/my-lxadmin-centos.cnf
下载后,更改名字为my.cnf .覆盖 /etc/my.cnf 文件,然后重新启动mysql数据库即可。
Getting a stampede of visitors but not reaching full profit potential? If you’re a webmaster with a superior site, why shouldn’t you have control over what you earn? Be the master of your domain! Clicksor Premium site partners have the option of ClicksorControl. It gives Premium publishers the best rates compared to any network. Clicksor [...]

Getting a stampede of visitors but not reaching full profit potential? If you’re a webmaster with a superior site, why shouldn’t you have control over what you earn? Be the master of your domain! Clicksor Premium site partners have the option of ClicksorControl. It gives Premium publishers the best rates compared to any network.
Clicksor offers webmasters the opportunity to earn more income by simply underlining a selection of clickable text (inline text links) or displaying targeted contextual ads (various sizes of banners) on their Web sites or blogs.
open a publiser account now and earn more money with clicksor
We use shortening URL services like TinyURL, Bit.ly, su.pr, etc on daily basis. These services are great, but have you thought of creating something similar your own? Setting up such service on your own is fairly easy, and if you are using WordPress it too comes with a plug-in that work seamlessly well. YOURLS (Your [...]
We use shortening URL services like TinyURL, Bit.ly, su.pr, etc on daily basis. These services are great, but have you thought of creating something similar your own? Setting up such service on your own is fairly easy, and if you are using WordPress it too comes with a plug-in that work seamlessly well.
YOURLS (Your Own URL Shortener) is what we’re talking about. It’s a free PHP script created by Lester Chan and Ozh Richard that allow you to create something similar to TinyURL and Bit.ly. We’ve installed and played around with it for a while, and here are our thoughts:
- Easy to install – If you’ve got no problem installing WordPress, then setting YOURLS is a piece of cake.
- Customizable links – You can customize the links instead of the random characters that make no sense.
- Statistics – An admin page that allows you to manage and keep track of details like date of creation, IP, clicks, etc.
- Public/Private links- You control whether this service is available for public to use or yourself only.
- Bookmarklet – Easy bookmarklet to create your own short URL on the fly.
Continue reading »
ItsHidden.com is the ultimate FREE surfing privacy service on the Internet with huge capacity and no complicated software to install, you already have everything you need on your computer right now! We are now also proud to launch our new paid service for more demanding uses!
ItsHidden.com is the ultimate FREE surfing privacy service on the Internet with huge capacity and no complicated software to install, you already have everything you need on your computer right now! We are now also proud to launch our new paid service for more demanding uses!
i always tell myself , i am just not so lucky, and i will change it if i do my best. but, it seems that , i am really a bad luck guy. live your life? It’s easy to say, but hard to do. The past years i lived makes me more and morelazy, you [...]
i always tell myself , i am just not so lucky, and i will change it if i do my best.
but, it seems that , i am really a bad luck guy. live your life? It’s easy to say, but hard to do.
The past years i lived makes me more and morelazy, you didn’t do anything, you get nothing, and you did a lot, you have nothing too.
maybe i just not satisfied. but how to keeping on my life? i need surprise , amazing, something i interesting.
今天几个站的流量全都降,但也算正常,越来越懒了.修改了广告调色之后,效果也是预料中的,看来一直以来我都在诱骗那些访问者,可是结果确实是很明显.我想我迟早要遭到惩罚.暂且全都不管了,因为还有更重要的事.我想我已经浪费了好几天的时间了.答应自己,这是件值得努力的事情,需要离开网络一小段时间.
今天几个站的流量全都降,但也算正常,越来越懒了.修改了广告调色之后,效果也是预料中的,看来一直以来我都在诱骗那些访问者,可是结果确实是很明显.我想我迟早要遭到惩罚.暂且全都不管了,因为还有更重要的事.我想我已经浪费了好几天的时间了.答应自己,这是件值得努力的事情,需要离开网络一小段时间.
adsense发钱了,去了趟农行终于有钱花了.当然开心了.回来之后打开电脑,发现从ename转出到name.com的域名终于complete了,从提交转移到完成,等待时间竟然是10天,10天等待换来的喜悦当然不一般了.接着看了一下在做的另一个国外ppc广告 clickor,没想到今天也支付了.$56多,$够了应该正好能赶上空间特价续费了.哈哈 感谢上帝!
adsense发钱了,去了趟农行终于有钱花了.当然开心了.回来之后打开电脑,发现从ename转出到name.com的域名终于complete了,从提交转移到完成,等待时间竟然是10天,10天等待换来的喜悦当然不一般了.接着看了一下在做的另一个国外ppc广告 clickor,没想到今天也支付了.$56多,$够了应该正好能赶上空间特价续费了.哈哈
感谢上帝!







Recent Comments