New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining Redis DBs #1609

Closed
timeassistant opened this Issue Jul 31, 2017 · 12 comments

Comments

Projects
None yet
5 participants
@timeassistant
Copy link

timeassistant commented Jul 31, 2017

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

This comment has been minimized.

Copy link
Contributor

jmarantz commented Jul 31, 2017

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Jul 31, 2017

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

This comment has been minimized.

Copy link
Contributor

morlovich commented Jul 31, 2017

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

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Jul 31, 2017

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]>

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Aug 24, 2017

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

This comment has been minimized.

Copy link
Contributor

ashishk-1 commented Aug 24, 2017

@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

This comment has been minimized.

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.

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Sep 11, 2017

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.

@oschaaf oschaaf closed this in db6e964 Sep 18, 2017

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Sep 19, 2017

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

This comment has been minimized.

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?).

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Sep 20, 2017

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 :)

@timeassistant

This comment has been minimized.

Copy link

timeassistant commented Jul 25, 2018

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 join this conversation on GitHub. Already have an account? Sign in to comment