打印

请问独立服务器php,mysql ,nginx 配置文件什么参数可以优化调整

谢谢军哥,用上了,军哥很敬业呵,向你学习!致敬!

TOP

MYSQL是5.5.42 我是lnmp1.2的,为何我替换了etc下的my.cnf文件不行的?如果用默认my.cnf,动态文件就很卡或者502错误,如果替换为my-huge的话,后台可以打开,但是出现No such file or directory。我的机器是linode 1G的RAM 1CPU

[ 本帖最后由 Wention 于 2016-2-25 22:09 编辑 ]

TOP

回复 17# 的帖子

什么地方报No such file or directory?
mysql日志有什么信息?
502时php-fpm和慢日志有什么信息?
反馈问题要尽可能提供多的信息

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

回复 18# 的帖子

No such file or directory是动态页面或者后台会出现,php-fpm重启了就不会卡,但是过会儿就卡成渣我是用飞飞CMS我试了下,如果把my.cnf替换了,可以打开播放页,但是搜索和后台会出现No such file or directory

[ 本帖最后由 Wention 于 2016-2-27 13:14 编辑 ]

TOP

始终502好蛋疼啊~!不知道怎么解决,哎

TOP

同时在线如达到几百个人,一会网站就挂掉,显示no such file or directory

军哥,你的忠实粉丝,默默支持了你好几年~~, 这几天网站只要达到同时几百人在线,就挂掉,出现no such file or directory,应该是mysql死掉了,差看mysql, 得到如下mysql垂死挣扎的过程:

170313 21:40:11 [Note] Event Scheduler: Loaded 0 events
170313 21:40:11 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.48-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
170313 23:24:56 mysqld_safe Number of processes running now: 0
170313 23:24:56 mysqld_safe mysqld restarted
170313 23:24:56 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.48-log) starting as process 18163 ...
170313 23:24:56 [Note] Plugin 'FEDERATED' is disabled.
170313 23:24:56 InnoDB: The InnoDB memory heap is disabled
170313 23:24:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170313 23:24:56 InnoDB: Compressed tables use zlib 1.2.3
170313 23:24:56 InnoDB: Initializing buffer pool, size = 128.0M
170313 23:24:56 InnoDB: Completed initialization of buffer pool
170313 23:24:56 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1589182633
170313 23:24:56  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1589183080
170313 23:24:56  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Last MySQL binlog file position 0 5299928, file name ./mysql-bin.000018
170313 23:24:57  InnoDB: Waiting for the background threads to start
170313 23:24:58 InnoDB: 5.5.48 started; log sequence number 1589183080
170313 23:24:58 [Note] Recovering after a crash using mysql-bin
170313 23:24:58 [Note] Starting crash recovery...
170313 23:24:58 [Note] Crash recovery finished.
170313 23:24:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
170313 23:24:58 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
170313 23:24:58 [Note] Server socket created on IP: '0.0.0.0'.
170313 23:24:58 [Note] Event Scheduler: Loaded 0 events
170313 23:24:58 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.48-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
170313 23:56:21 mysqld_safe Number of processes running now: 0
170313 23:56:21 mysqld_safe mysqld restarted
170313 23:56:21 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.48-log) starting as process 18532 ...
170313 23:56:21 [Note] Plugin 'FEDERATED' is disabled.
170313 23:56:21 InnoDB: The InnoDB memory heap is disabled
170313 23:56:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170313 23:56:21 InnoDB: Compressed tables use zlib 1.2.3
170313 23:56:21 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
170313 23:56:21 InnoDB: Completed initialization of buffer pool
170313 23:56:21 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170313 23:56:21 [ERROR] Plugin 'InnoDB' init function returned error.
170313 23:56:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170313 23:56:21 [ERROR] Unknown/unsupported storage engine: InnoDB
170313 23:56:21 [ERROR] Aborting

170313 23:56:21 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170313 23:56:21 mysqld_safe mysqld from pid file /usr/local/mysql/var/li1206-174.pid ended


用的是 Linode 4096系列主机,想问一下是主机不行还是需要更改mysql的什么配置文件? 如下是php-fpm 设置

[www]
listen = /tmp/php-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 50
pm.start_servers = 30
pm.min_spare_servers = 20
pm.max_spare_servers = 50
request_terminate_timeout = 100
request_slowlog_timeout = 0
slowlog = var/log/slow.log


恳请军哥看到了回复下...

TOP

回复 21# 的帖子

只按这个日志看是内存不够用了,需要调小innodb_buffer_pool_size的值,调小再看看

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

回复 22# 的帖子

谢谢军哥回复,我先改改试试~

TOP

军哥,修改后再也没有出现网站崩溃的情况了,太感谢了

TOP