Skip to content
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

Doesn't return stream for large databases #54

Open
refrigerator opened this issue Aug 1, 2016 · 5 comments
Open

Doesn't return stream for large databases #54

refrigerator opened this issue Aug 1, 2016 · 5 comments

Comments

@refrigerator
Copy link

Here's my app.js in node:

var express = require("express");
var repStream = require('express-pouchdb-replication-stream');
var app = express();

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "http://localhost:4200");
  res.header("Access-Control-Allow-Credentials", true);
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

app.get("/",function(req,res){
        res.send("<h1>Hello from EC2</h1>");
});

app.use('/api/couchdb/:db', repStream({
  url     : 'http://sync:4theg00doftheherd@54.149.99.123:5984/',
  dbReq   : true,
  replication: {batch_size: 100}
}));

app.listen(80);

"app.js" 22L, 650C

It works fine for small databases, but when I request a larger CouchDB database (20MB+) nothing gets returned. Is there some sort of setting that I need to turn on? Thanks

@calvinmetcalf
Copy link
Collaborator

if your on amazon there is a destinct change of buffering being an issue

On Mon, Aug 1, 2016 at 1:06 PM Taimur Abdaal notifications@github.com
wrote:

Here's my app.js in node:

var express = require("express");
var repStream = require('express-pouchdb-replication-stream');
var app = express();

app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "http://localhost:4200");
res.header("Access-Control-Allow-Credentials", true);
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});

app.get("/",function(req,res){
res.send("

Hello from EC2

");
});

app.use('/api/couchdb/:db', repStream({
url : 'http://sync:4theg00doftheherd@54.149.99.123:5984/',
dbReq : true,
replication: {batch_size: 100}
}));

app.listen(80);

"app.js" 22L, 650C

It works fine for small databases, but when I request a larger CouchDB
database (20MB+) nothing gets returned. Is there some sort of setting that
I need to turn on? Thanks


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#54, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABE4nzduogwvwf1VVdH2bQeqaAcJM8hZks5qbiekgaJpZM4JZyuH
.

@refrigerator
Copy link
Author

Thanks @calvinmetcalf - I am indeed on AWS (EC2), any ideas how to fix it? Or should I try hosting somewhere else?

@calvinmetcalf
Copy link
Collaborator

you probably have nginx or something setup

@refrigerator
Copy link
Author

@calvinmetcalf is there something I can configure in nginx to fix it?

@calvinmetcalf
Copy link
Collaborator

yes I believe you should be turning off 'proxy_buffering'. There is something called 'server sent events' which has similar issues so if you google for guides to getting server sent events to work with nginx you'll find the instructions you need

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

No branches or pull requests

2 participants