Some time my erpnext server is getting hang and after few minutes its working but very slow

Not sure if you have done this since you did not state this in your problem statement, I assume you haven’t.

The default ERPNExt installation only have one GNUWorker Unit.

You may want to increase the number of server threads by configuring the Gunicorn Workers.

For more information , read this: Increasing number of gunicorn workers - #5 by vaibhavk