Default to using Mongo for caching

Stress testing shows that after the recent caching optimization there
seems to be no significant difference in performance when using Mongo
for caching as opposed to Redis. Redis is still supported but is now
optional.

Also removed hiredis dependency since as of node_redis 2.6 the default
parser is faster than hiredis.
This commit is contained in:
Zaid Abdulla committed 2017-06-01 16:34:42 -07:00
1 parent b1ed1f4f2f
commit b38b3cf5ab
5 files changed
+8 -10

No files matched your search

+3 -4
View File
@@ -16,12 +16,11 @@ systems
## Quick Start ## Quick Start
Install [Node.js](http://nodejs.org/), [Redis](http://redis.io/), and Install [Node.js](http://nodejs.org/) and [MongoDB](http://www.mongodb.org/).
[MongoDB](http://www.mongodb.org/). Refer to the corresponding documentation for Refer to their corresponding documentation for installation instructions. The
installation guides. Supported versions are: supported versions are:
- Node.js: 6.x and 7.x (7.x recommended) - Node.js: 6.x and 7.x (7.x recommended)
- Redis: 2.4 through 3.2
- MongoDB: 2.6 through 3.4 - MongoDB: 2.6 through 3.4
Then install GenieACS using NPM: Then install GenieACS using NPM:
-2
View File
@@ -1,7 +1,5 @@
{ {
"MONGODB_CONNECTION_URL" : "mongodb://127.0.0.1/genieacs", "MONGODB_CONNECTION_URL" : "mongodb://127.0.0.1/genieacs",
"REDIS_PORT" : "6379",
"REDIS_HOST" : "127.0.0.1",
"CWMP_INTERFACE" : "0.0.0.0", "CWMP_INTERFACE" : "0.0.0.0",
"CWMP_PORT" : 7547, "CWMP_PORT" : 7547,
"CWMP_SSL" : false, "CWMP_SSL" : false,
+1 -1
View File
@@ -24,7 +24,7 @@ options = {
CONFIG_DIR : {type : 'path', default : 'config'}, CONFIG_DIR : {type : 'path', default : 'config'},
MONGODB_CONNECTION_URL : {type : 'string', default : 'mongodb://127.0.0.1/genieacs'}, MONGODB_CONNECTION_URL : {type : 'string', default : 'mongodb://127.0.0.1/genieacs'},
REDIS_PORT : {type : 'int', default : 6379}, REDIS_PORT : {type : 'int', default : 6379},
REDIS_HOST : {type : 'string', default : '127.0.0.1'}, REDIS_HOST : {type : 'string', default : ''},
REDIS_DB : {type : 'int', default : 0}, REDIS_DB : {type : 'int', default : 0},
CWMP_WORKER_PROCESSES : {type : 'int', default : 0}, CWMP_WORKER_PROCESSES : {type : 'int', default : 0},
+1 -1
View File
@@ -601,7 +601,7 @@ getSession = (httpRequest, callback) ->
currentSessions = new WeakMap() currentSessions = new WeakMap()
# When socket closes, store active sessions in redis # When socket closes, store active sessions in cache
onConnection = (socket) -> onConnection = (socket) ->
currentSessions.set(socket, {}) currentSessions.set(socket, {})
socket.on('close', () -> socket.on('close', () ->
+3 -2
View File
@@ -19,13 +19,14 @@
"bin": "bin" "bin": "bin"
}, },
"dependencies": { "dependencies": {
"hiredis": "^0.5.0",
"later": "^1.2.0", "later": "^1.2.0",
"libxmljs": "^0.18.4", "libxmljs": "^0.18.4",
"mongodb": "^2.2.24", "mongodb": "^2.2.24",
"redis": "^2.6.5",
"seedrandom": "^2.4.2" "seedrandom": "^2.4.2"
}, },
"optionalDependencies": {
"redis": "^2.6.5"
},
"devDependencies": { "devDependencies": {
"coffeescript": "^1.12.4" "coffeescript": "^1.12.4"
}, },