Perhaps using something like keepalived on your server and Pi could be useful here. When the server is off the ip will failover to the Pi to receive server traffic to know when to power on the server. Once the request comes in and the pi powers on the server, it'll come active again and recieve the IP while the pi goes in to standby. That way the Pi doesnt need to be in the read or write path.