iTunes Library disappears after some hours

iHomeServer relies on iTunes to support Home Sharing and Air Play functionality.  iHomeServer does not mediate this functionality, is simply spawns an iTunes process that will act as the Home Sharing server.
Some users have reported intermitted problems with their iTunes library disappearing or being inaccessible after some time.  This is a general iTunes issue rather than an iHomeServer issue, therefore it is worth searching the internet for user feedback and suggested workarounds. 
Below, we also outline some known potential causes and workarounds:
  1. iTunes may be busy

    If iHomeServer is indexing a large amount of files, it is possible that iTunes is busy importing media and therefore cannot service Home Sharing requests.  When iHomeServer is performing batch operations it attempts to yield control back to iTunes to allow it to process other tasks, however, iTunes does not multi-thread flawlessly.  You can cancel long running scanning or indexing operations from the iHomeServer Console to see whether this resolves the issue.  This will be more of an issue on slow servers with limited CPU.
  2. Extend DHCP lease time or preferably assign static IP addresses for all devices

    By far the most common reason for Apple devices to stop seeing your iTunes library has been due to DHCP timeouts.  Most networks are set up to provide temporary IP addresses to devices on the network using a protocol called DHCP.  These IP address leases may be as short as 24 hours.  When the IP lease expires, the device will get a new IP address.  iTunes's Home Sharing is designed to handle devices changing their IP addresses, however, some times this does not work correctly and an Home Sharing client (such as an Apple TV) can no longer see the server.  We suggest extending the DHCP timeout (typically done within the admin GUI of your router) to a longer period, eg a week to see whether the Library remains available for longer.  Alternatively, and preferably, configure static IP addresses for all your iTunes / Home Sharing devices - ensuring the static IP address is outside the range of your DHCP pool.
  3. Turn off sleep mode

    If your server is configured to go to sleep, then it may not wake up successfully when a Home Sharing client requests media.  If your iTunes library disappears and you have enabled sleep on your server, we suggest temporarily disabling sleep to see whether it resolves the issue.
  4. Disable IPv6 and reboot

    Many internet forums suggest disabling the IPv6 protocol on your iTunes server and rebooting to increase the stability of iTunes Home Sharing.  It is beyond the scope of this topic to describe how to do this, however, step by step guides are readily available on the internet.
  5. Try wired connections instead of wireless connections

    If only some of your devices cannot see your shared iTunes library, or you intermittedly lose AirPlay devices on your network, check your wifi signal strength at each device and, if possible, switch to wired LAN connections instead of wireless wi-fi connections which are more reliable particularly for streaming media.
  6. Temporarily disable AntiVirus and / or Firewall Software

    Some users have reported incompatibilities between iTunes and either their AntiVirus or Firewall software.  If you are continuing to have intermittent connectivity issues, we suggest temporarily disabling or removing antivirus and/or firewall software (including Windows Firewall) to see whether that resolves your issue.  If this fixes it then review the settings on the AV/FW or try a different product.  Note that this is an iTunes issue and not an iHomeServer issue.
  7. Run iTunes interactively

    If Home Sharing instability persists past these recommendations, then we recommend temporarily not running iTunes under iHomeServer console and instead just run iTunes standalone in a Remote Desktop Session on your server.  Repeat your tests and see whether Home Sharing remains more stable when running iTunes stand-alone.  If iTunes is stable when running interactively, but unstable when running under iHomeServer then please raise a support call and send us your iHomeServer log files for analysis.