When we are writing a pyspark dataframe to s3 from EC2 instance using pyspark code the time taken to complete write operation is longer than usual time. Earlier it used to  take 30 min to complete the write operation for 1000 records, but now it is taking more than an hour. Also after completion of the write operation the context switch to next lines of code is taking longer time(20-30min). We are not sure whether this is AWS-s3 issue or else because of lazy computation of Pyspark. Could anybody throw some light on this quesion.
Thanking in advance
It seems an issue with the cloud environment. Four things coming to my mind, which you may check:

Spark version: For some older version of spark, one gets S3 issues.
Data size being written in S3, and also the format of data while storing
Memory/Computation issue: The memory or CPU might be getting utilized to maximum levels.
Temporary memory storage issue- Spark stores some intermediate data in temporary storage, and that might be getting full. 

So, with more details, it may become clear on the solution.
writing a pyspark dataframe to AWS - s3 from EC2 instance using pyspark code the time taken to complete write operation is longer than usual time