Title: wp_remote_post and timeout
Last modified: August 21, 2016

---

# wp_remote_post and timeout

 *  [Antonio Villegas](https://wordpress.org/support/users/avillegasn/)
 * (@avillegasn)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/wp_remote_post-and-timeout/)
 * Hi folks, I have a problem that’s driving me nuts.
 * When using wp_remote_post with a certain timeout, the higher the timeout is, 
   the longer it takes to get an answer from the server.
 * For example, if I use a timeout of 5 seconds, I can get the answer successfully
   in just a couple of seconds.
 * If, on the other hand, I set the timeout to 30 seconds, it takes up to 25 seconds
   to get the answer
 * BTW, I’m using wp_remote_post in a function that’s called via admin-ajax.php
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/wp_remote_post-and-timeout/#post-4843966)
 * I don’t know for a fact, but I suspect servers respond to requests in order of
   closest to expiration, not first in first out. The timeout setting factors into
   the request expiration time, so busy servers do not respond until there is a 
   risk of an exception being thrown, which would increase its workload.
 * A shorter timeout would begin to result in an increase of exceptions and retries.
   The optimal setting is as short as possible with a tolerable error rate. I suspect
   a sophisticated communications protocol (a theoretical one, not necessarily HTTP)
   constantly adjusts this time for a particular connection to maximize throughput.

Viewing 1 replies (of 1 total)

The topic ‘wp_remote_post and timeout’ is closed to new replies.

## Tags

 * [timeout](https://wordpress.org/support/topic-tag/timeout/)
 * [wp_remote_post](https://wordpress.org/support/topic-tag/wp_remote_post/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/wp_remote_post-and-timeout/#post-4843966)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
