title: Cron Job - Read error (Connection timed out) in headers
body: <p>I have recently taken over hosting a site that is run in EE (latest version). My EE knowledge is not amazing, however, this project my way to get into using it.</p>
  
  <p>The site in question also uses SPEKTRIX to manage a whole bunch of things that go on at their venue. It also uses DataGrab to run some imports that automatically create instances with the EE site for the managers to then edit and open etc…</p>
  
  <p>These DataGrab jobs are run as Cron jobs and they work fine. However, recently I have been getting these error through for one of the scripts.</p>
  
  <pre><code>--2014-05-27 07:05:01--  http://www.domain.co.uk/spektrix/auto-import
  Resolving www.domain.co.uk... xxx.xx.xxx.x
  Connecting to www.domain.co.uk|xxx.xx.xx.x|:80... connected.
  HTTP request sent, awaiting response... 302 Moved Temporarily
  Location: http://www.domain.co.uk/spektrix/instances-import [following]
  
  --2014-05-27 07:05:47--  http://www.domain.co.uk/spektrix/instances-import
  Reusing existing connection to www.domain.co.uk:80.
  HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
  Retrying.
  
  --2014-05-27 07:20:48-- (try: 2)  http://www.domain.co.uk/spektrix/instances-import
  Connecting to www.domain.co.uk|xxx.xx.xxx.x|:80... connected.
  HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
  Retrying. 
  </code></pre>
  
  <p>I have no idea why this has suddenly started playing up when the same script gave the following response</p>
  
  <pre><code>--2014-05-24 09:05:01--  http://www.domain.co.uk/spektrix/auto-import
  Resolving www.domain.co.uk... xxx.xx.xxx.x
  Connecting to www.domain.co.uk|xxx.xx.xxx.x|:80... connected.
  HTTP request sent, awaiting response... 302 Moved Temporarily
  Location: http://www.domain.co.uk/spektrix/instances-import [following]
  
  --2014-05-24 09:05:19--  http://www.domain.co.uk/spektrix/instances-import
  Reusing existing connection to www.domain.co.uk:80.
  HTTP request sent, awaiting response... 200 OK
  Length: unspecified [text/html]
  Saving to: `auto-import.531'
  
  0K .......... .......... .......... .......... ..........  134M
  50K .......... .                                           21387G=0s
  
  2014-05-24 09:13:57 (165 MB/s) - `auto-import.531' saved [62682] 
  </code></pre>
  
  <p>Any help would be appreciated in this guys</p>
  
  <p>Thanks</p>
  
  <p>/* UPDATE */</p>
  
  <p>It is using wget via cpanel to run the scripts</p>
  
  <p>5 0 * * * wget '<a href="http://www.domain.co.uk/assets/auto/set-expiry-date.php" rel="nofollow">http://www.domain.co.uk/assets/auto/set-expiry-date.php</a>'</p>
  
  <p>5 * * * * wget '<a href="http://www.domain.co.uk/spektrix/auto-import" rel="nofollow">http://www.domain.co.uk/spektrix/auto-import</a>'</p>
  
  <p>0 * * * * wget '<a href="http://www.domain.co.uk/assets/auto/extend-expiry-date.php" rel="nofollow">http://www.domain.co.uk/assets/auto/extend-expiry-date.php</a>'</p>
  
  <p>The auto-import is the only one that has the timeout issue.</p>
  
  <p>It's also worth noting that when the timeout occurs causes the server to have a high CPU / memory load. </p>
  
  <p>I have restarted cron and waited for the job to restart and ran the command 'top' while the cron was running</p>
  
  <pre><code>PID  USER    PR  NI  VIRT  RES  SHR  S %CPU   %MEM  TIME+     COMMAND           
  1617 mysql   20  0 3 450m  244m 6008 S 234.1  1.2   17048:40  mysqld
  </code></pre>