Issue with Upgrade to version 9 from v7.. site is extremely slow compared to before

Hello,

I have an ERPNEXT v7.2.2 and tried to upgrade to the v9, i ran the command (bench update --upgrade) however there were many changes in the new version release and I tried very hard to upgrade but could not successfully do that, then had no option but to try and have my old version back (v7.2.2), so I went ahead and carried out the instructions as per the link below, to reverse the action:
git reset --hard “v7.2.2” on both of erpnext and frappe

BUY now the site takes ages to load … can you suggest the reason or possibly a solution to this…

Having said this I have not added any bench or even sites, and RAM and CPU or Hard Drive of the hosting VPS is 50% free.

I greatly appreciate your help.

Could you kindly advise

Try
sudo setup supervisor
sudo setup nginx
sudo supervisorctl reload
sudo service nginx reload

in the same sequense

i hope this will help u to get your performance back

Dear Bassam,

Thank you for your response, I have tried the above in the sequence you mentioned, however I am still facing the same issue when I run on of the sites (I have 3 sites in on one bench frappe-bench), then I did more research on the web could not find the reason.

Then I contacted my VPS provider then they carried out a test analysis to find out what is causing the issue… They informed me it is nothing to do with them BUT sent me the below email:

"
The VPS itself is not overloaded but has a lot of active nginx connections:

root@erp:/# netstat -punta |grep nginx |wc -l
1017

Which is causing the 504 gateway time-out errors. I will advise you to check your nginx error log in order to resolve this problem.
"

Not sure what is causing this … could you kindly assist ?

Thank you

I checked the nginx log I am seeing almost 22000 lines of same error as below:

2017/10/06 20:30:38 [error] 876#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 130.193.224.188, server: site1.local, request: “GET /socket.io/?EIO=3&transport=polling&t=1507336235640-15126 HTTP/1.1”, upstream: “http://127.0.0.1:9000/socket.io/?EIO=3&transport=polling&t=1507336235640-15126”, host: “my-vps-ip:88”, referrer: “http://my-vps-ip:88/desk

Can you please help? I am really stuck

it looks like something going wrong on your server
so try this
sudo bench config http_timeout 6000
sudo bench setup supervisor
sudo bench setup nginx
sudo supervisorctl reload
sudo service nginx reload