Redis cache/session support over socket #201

Closed
opened 2025-11-02 03:13:41 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @francoism90 on GitHub (Jan 5, 2017).

  • Gitea version (or commit ref): git
  • Git version: master
  • Operating system: Arch Linux x64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Trying to setup redis over socket for caching and session, but unable to get it working.
Is it supported? MySQL over socket works perfectly fine.

Thanks. :)

Originally created by @francoism90 on GitHub (Jan 5, 2017). - Gitea version (or commit ref): git - Git version: master - Operating system: Arch Linux x64 - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description Trying to setup redis over socket for caching and session, but unable to get it working. Is it supported? MySQL over socket works perfectly fine. Thanks. :)
GiteaMirror added the issue/not-a-bug label 2025-11-02 03:13:41 -06:00
Author
Owner

@lunny commented on GitHub (Jan 5, 2017):

How do you config that? Could you post your config options here?

@lunny commented on GitHub (Jan 5, 2017): How do you config that? Could you post your config options here?
Author
Owner

@francoism90 commented on GitHub (Jan 11, 2017):

@lunny this is what I'm trying to do:

[cache]
; Either "memory", "redis", or "memcache", default is "memory"
ADAPTER = redis
; For "memory" only, GC interval in seconds, default is 60
INTERVAL = 60
; For "redis" and "memcache", connection host address
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
; memcache: `127.0.0.1:11211`
HOST =network=socket,addr=/var/run/redis/redis.sock,db=0,pool_size=100,idle_timeout=180

[session]
; Either "memory", "file", or "redis", default is "memory"
PROVIDER = redis
; Provider config options
; memory: not have any config yet
; file: session file path, e.g. `data/sessions`
; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180
; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
PROVIDER_CONFIG = data/sessions

I'm a bit confused, should it be NETWORK= or HOST=.
Also for [session] a key seem to be missing.

Thanks, and please let me know if you need more info. :)

@francoism90 commented on GitHub (Jan 11, 2017): @lunny this is what I'm trying to do: ``` [cache] ; Either "memory", "redis", or "memcache", default is "memory" ADAPTER = redis ; For "memory" only, GC interval in seconds, default is 60 INTERVAL = 60 ; For "redis" and "memcache", connection host address ; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 ; memcache: `127.0.0.1:11211` HOST =network=socket,addr=/var/run/redis/redis.sock,db=0,pool_size=100,idle_timeout=180 [session] ; Either "memory", "file", or "redis", default is "memory" PROVIDER = redis ; Provider config options ; memory: not have any config yet ; file: session file path, e.g. `data/sessions` ; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 ; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` PROVIDER_CONFIG = data/sessions ``` I'm a bit confused, should it be NETWORK=<socket> or HOST=<socket>. Also for [session] a key seem to be missing. Thanks, and please let me know if you need more info. :)
Author
Owner

@bkcsoft commented on GitHub (Jan 21, 2017):

@francoism90 network=unix most likely?

@bkcsoft commented on GitHub (Jan 21, 2017): @francoism90 `network=unix` most likely?
Author
Owner

@lnicola commented on GitHub (Jan 24, 2017):

I can confirm that network=unix,addr=/var/run/redis/redis.sock works, but nothing seems to get cached for me.

@lnicola commented on GitHub (Jan 24, 2017): I can confirm that `network=unix,addr=/var/run/redis/redis.sock` works, but nothing seems to get cached for me.
Author
Owner

@lunny commented on GitHub (Feb 11, 2017):

So I think that's ok. If redis doesn't cache anything. That should be another issue I think. Of course, please feel free to reopen this one.

@lunny commented on GitHub (Feb 11, 2017): So I think that's ok. If redis doesn't cache anything. That should be another issue I think. Of course, please feel free to reopen this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#201