title: Caching MaxMind City bindary database in RAM + Server performance
body: <p>I've been trying to find a proper GeoIP database for our application and as far as I can tell MaxMind City is probably the best (though if I'm wrong please let me know!).
  I'm currently trying out the free version which isn't really accurate in the UK, but it will do for testing purposes. </p>
  
  <p>So getting back to the topic:</p>
  
  <p>Our app is written in PHP and eventually we'll be having a lot of incoming traffic. The reason why we'll be using the GeoIP database is because we need to display the city, region, country on every page load as well as save the data for a specific visitor onto a mysql database. So I started thinking that loading the binary data on every page request will cause the server to consume a lot of RAM and will increase the processing speed. That's why <strong>I'm wondering if it's possible to cache it inside RAM and fecth it with PHP</strong>, because it's 26Mb (I know it might not seem to be a lot), but still when we start to get thousands of page requests per second this will result in performance decrease which we obviously want to avoid.</p>
  
  <p><strong>The server:</strong></p>
  
  <p>Processor:  16 GHz (8 x 2 GHz)</p>
  
  <p>RAM:            16384 MB </p>
  
  <p>HDD:            400 GB</p>
  
  <p>Apache + Nginx + Varnish, PHP5.3, MySQL5.1</p>
  
  <p>We're quite new to large-scale app development so if you have any suggestions how to improve performance in general, or have any other tips related to increasing performance for our case let me know.</p>
  
  <p>Thanks!</p>