Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Defining Redis DBs #1609

Closed
AWOL-TECH opened this issue Jul 31, 2017 · 12 comments
Closed

Defining Redis DBs #1609

AWOL-TECH opened this issue Jul 31, 2017 · 12 comments

Comments

@AWOL-TECH
Copy link

Hi there,

I am wondering if there is a way to specify which Redis DB to use when adding Redis cache.

I couldn't find any documentation on it, normally you would set some kind of "Define_redis_DB = #" statement. I use Redis for many things so I am needing to set pagespeed to a specific DB ID (16)

Thanks

@jmarantz
Copy link
Contributor

jmarantz commented Jul 31, 2017 via email

@AWOL-TECH
Copy link
Author

Thanks for a fast response :)

Yeah sadly I never saw the option in that doc page either.

If this option doesnt exist, I'd definitely like to recommend it as a feature request!

For now I guess I'll just need to free up DB 0 for Pagespeed and find a new home for anything currently using it already !

Thanks

Greg

@morlovich
Copy link
Contributor

Looks like we would need to send one of these:
https://redis.io/commands/select
To support it.

@AWOL-TECH
Copy link
Author

Yes, that is the CLI command
e.g.

[root@server]# redis-cli
127.0.0.1:6379> select 5
OK
127.0.0.1:6379[5]>

@AWOL-TECH
Copy link
Author

As an update, the correct way for us to do this should be

ModPagespeedRedisServer "tcp://127.0.0.1:6379?database=7"

However when you save that and reboot apache there are 2 problems - first you cannot use the tcp:// part second it will not currently recognise ?database=#

so the main request is to obviously have this added and enabled in the configuration.

I have inlucded the error log entries below to show what I mean.

Starting httpd: AH00526: Syntax error on line 242 of /etc/apache2/conf.modules.d/456_pagespeed.conf:
Cannot set option RedisServer to 127.0.0.1:6379?database=16. Port specified is not a valid number: '6379?database=16'
Starting httpd: AH00526: Syntax error on line 242 of /etc/apache2/conf.modules.d/456_pagespeed.conf:
Cannot set option RedisServer to tcp://127.0.0.1:6379?database=16. Expected single server in format <host>[:<port>]

Starting httpd: AH00526: Syntax error on line 242 of /etc/apache2/conf.modules.d/456_pagespeed.conf:
Cannot set option RedisServer to tcp://127.0.0.1:6379. Expected single server in format <host>[:<port>]

@ashishk-1
Copy link
Contributor

@timeassistant ,
I would propose to have database index specification separate from redis server config.

Keeping redis server config as host and port only will remain similar to other servers such as mem cached server, fetch proxy etc.
Also database id will not serve any purpose in case of redis cluster.

@oschaaf
Copy link
Member

oschaaf commented Aug 24, 2017

+1 for a separate setting. In addition to @ashishk-1's comment above, I think it would be useful to be able set the connection information at the root level configuration, and inherit that into server configurations, defining the different database-id's there.

@AWOL-TECH
Copy link
Author

I can see the reasoning for separating the server config and the database specification. A separate parameter would be perfectly fine too.

In regards to clustering, I don't use it so I don't know the effect it would have, but for a single instance the option the specify a database would be very useful.

@AWOL-TECH
Copy link
Author

Hey @oschaaf and @ashishk-1 I see that this has been added thats great !

I was just wondering real quick, I use the cpanel module with EA4, I was just wondering if this will work with that too? I tried to test but had no luck

thanks

@oschaaf
Copy link
Member

oschaaf commented Sep 20, 2017

@timeassistant could you elaborate on how you tested this? (there is no release yet containing this feature, did you build the bleeding edge from source?).

@AWOL-TECH
Copy link
Author

I guess that explains it ! I actually thought it had been released so I used a test machine and installed from source

Don't worry I'll wait for the release :)

@AWOL-TECH
Copy link
Author

Sorry for resurrecting an old issue.

The cpanel version of this hasn't been updated in like 2 years. Is there an easy way to update to latest version in cpanel? I still can't define Redis DBs :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants