简体   繁体   中英

My EC2 server instance is running on a infinite loop in PHPU. How do I stop it?

My server is running on 100% CPU. It is running on a infinite loop in PHP how do I kill the loop? can I reboot without loosing any data?

Using the AWS Console 'Reboot Instance' option will, unsurprisingly, reboot the VM. Presupposing that your looping process is not set to auto-start on boot, you'll regain control of the VM. You will not lose any persisted data (ie committed to the disk) but you may well lose any transient data that the process was working on when it was killed during the reboot (eg unflushed write buffers).

It makes no difference whether the dataset is on the instance ephemeral storage (the boot volume) or another EBS volume - reboot does not clear these down. Note that if you Terminate the instance instead and re-instantiate it, you'll lose any data on the ephemeral volume (but not on attached EBS - this gets detached during the termination and you can re-attach it to the new instance).

Good practice: regular volume snapshots of any attached data volumes, and routine of stop/snapshot/restart on your VM will let you back-up your ephemeral volume too.

使用AWS控制台重新启动

使用ps aux列出您的进程(假设您从CLI出发, ps aux | grep php应该过滤您的php脚本)查找导致此问题的脚本的进程ID(pid),然后发出kill <pid>将其杀死。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM