VPS侦探论坛

 找回密码
 注册
12
返回列表 发新帖
楼主: 垃圾熊

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

[复制链接]
发表于 2015-8-20 14:51:39 | 显示全部楼层

谢谢军哥,用上了,军哥很敬业呵,向你学习!致敬!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-2-25 21:59:33 | 显示全部楼层


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 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-2-26 10:34:03 | 显示全部楼层

回复 17# 的帖子


什么地方报No such file or directory?
mysql日志有什么信息?
502时php-fpm和慢日志有什么信息?
反馈问题要尽可能提供多的信息
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-2-26 13:22:40 | 显示全部楼层

回复 18# 的帖子




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

[ 本帖最后由 Wention 于 2016-2-27 13:14 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-2-27 11:14:00 | 显示全部楼层

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

军哥运维代购:http://shop63846532.taobao.com/

发表于 2017-3-14 10:45:55 | 显示全部楼层

同时在线如达到几百个人,一会网站就挂掉,显示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


恳请军哥看到了回复下...
发表于 2017-3-14 15:55:44 | 显示全部楼层

回复 21# 的帖子


只按这个日志看是内存不够用了,需要调小innodb_buffer_pool_size的值,调小再看看
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-3-14 17:58:47 | 显示全部楼层

回复 22# 的帖子


谢谢军哥回复,我先改改试试~
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-5-14 12:21:23 | 显示全部楼层


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

军哥运维代购:http://shop63846532.taobao.com/

发表于 2022-11-2 15:27:25 | 显示全部楼层



请问军哥,此篇优化参数现在还适用吗?谢谢。
发表于 2022-11-2 16:16:20 | 显示全部楼层

520dchk 发表于 2022-11-2 15:27
请问军哥,此篇优化参数现在还适用吗?谢谢。

参数都还是那些
发表于 2022-11-2 19:04:37 | 显示全部楼层

licess 发表于 2022-11-2 16:16
参数都还是那些

好的,谢谢。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-26 13:19 , Processed in 0.030027 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表