Taking too long to retrieve REST Webservice data

Hi I have a question on the REST service→ Get method. I have around 68-70 columns to export through the webservice. It seems to be taking long time to retrieve the data. However i do get the messsage session attempted to be removed in 300 seconds. Dev takes too long time, in prod it displays 500- error code. Could you please advise how to go about getting data at good response time?   Thanks
1 answers

Hard to say without a bit more info. What is your use case? How many records do you need to export? How long is the query taking by itself? Odata supports paging the response, which breaks up a big query into multiple smaller once. Would it be an option to use this?