Subscribe by email. Add subscribe by CSV file doesn't work.

Subscribe by email. Add subscribe by CSV file doesn't work.
I have a CSV file with over 40.000 email to add but every time I use it, it loads more or less 3000 email and then I get the following error message:
"Gateway Timeout
The gateway did not receive a timely response from the upstream server or application."

Do you know why?