Why is Phoenix Project using 100% CPU of Digital Ocean droplet?

Pgadmin. As pointed out in the thread, from now on I will be setting up and using SSH tunnel.

2 Likes

Might be irrelevant, but one day I found my CPU run at 100%. After nearly an hour of debugging I found that its only behave like that every time my phoenix app run and to be spesific: everytime certain url is opened.

The cause is dead silly and entirely my stupidity: I accidentally put layout content in a template. So it make infinite render loop.

2 Likes

Did you try kill -9 on both the OHQ6mh processes? Did they come back? Does postgresql still function without those processes? If you reboot the server does OHQ6mh come back or does it come back under a different name? I have so many questions! :slight_smile:

While the traffic for the port 22 will not decrease, by listening in a different ssh port you are eliminating all the possibilities for that automated attacks againts port 22 to succeed.

Now you can say they can do a port scan and find the ssh port your are listening and attack it, but this is valid only for manual attacks or advanced scripts, because the majority of the attacks you see in the logs are scripts that only attack port 22.

So this being said I strongly recommend anyone to use a different ssh port, and please don’t go with the widely used 2222 or 2020, just choose a weird number.

Even if you choose a different port for each ssh server you need to ssh into, that’s very easy to manage from ~/.ssh/config:

Host *
   ServerAliveInterval 100
   #IdentitiesOnly=yes

Host server1
         HostName  123.456.78.90
         IdentitiesOnly=yes
         IdentityFile ~/.ssh/id_rsa_server1
         user core
         Port 1234

Host server2
        HostName 321.456.78.91
        IdentitiesOnly=yes
        IdentityFile ~/.ssh/id_rsa_server2
        User git
        Port 4321
2 Likes

I deleted my droplet on this thread’s suggestion and hapiliy running a new droplet with no hacking issues beacuse I learnt and implemented basic security features. However Ill still try to answer.

1,2. I didnt try kill-9 but I restarted the droplets many times. At every restart, the miner processes would start.
3. Yes because at restart of droplet postgresql works but it takes 10-15 minutes for the miner processes to resurface
4. On rebooting droplet, miner processes come back with a different name.
5. You can ask me more Qs if you like.

4 Likes

Glad you found the answer! Ran down a few rabbit holes to get there. :slight_smile:

see ya
ken