I have seen several references to people running Redis on Azure, but no implementation or any sort of 'howto' on it. Has anyone seen such an example?
you can do it by this way. $redis = new Redis(); $redis->connect('127.0. 0.1', 6379); echo $redis->ping(); and then check if it print +PONG , which show redis-server is running.
For the time being, there is no deactivate or disable command.
You can use redis-benchmark.exe to load test your Redis server. Ensure that the load testing client and the Azure Cache for Redis are in the same region. Use redis-cli.exe and monitor the cache using the INFO command. If your load is causing high memory fragmentation, you should scale up to a larger cache size.
You should enter an interactive session where you see every command sent to redis. Reload your page and on your terminal you should see some SET* operations storing the cache data. Reload again and if your cache works, you should see some GET* operations retrieving the cached data.
In the service definition file add the following config
<WorkerRole name="my.Worker" vmsize="Small"> <Runtime executionContext="limited"> <EntryPoint> <ProgramEntryPoint commandLine="redis-server.exe" setReadyOnProcessStart="true" /> </EntryPoint> </Runtime> <Imports> <Import moduleName="Diagnostics" /> <Import moduleName="RemoteAccess" /> <Import moduleName="RemoteForwarder" /> </Imports> <Endpoints> <InternalEndpoint name="Redis" protocol="tcp" port="6379" /> </Endpoints> </WorkerRole>
You can refer to the redis server from your web role using the following
var ipEndpoint = RoleEnvironment.Roles["my.Worker"].Instances[0].InstanceEndpoints["Redis"].IPEndpoint; host = string.Format("{0}:{1}", ipEndpoint.Address, ipEndpoint.Port);
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With