My site is slow and showing 524 error

My site is incredibly slow and sometimes shows a 524 error.