3

We are going to use bigcouch to serve images. The max image size is ~5MB. The config value is at 64MB. Should we change it to somewhere close? What is the reason behind it?

Thanks,

Kathleen

  • I dun think is a good idea to use nosql, you probably not able to make use of CDN after all (and not mentioned the browser cache, api call overhead) – ajreal Feb 16 '12 at 05:32

2 Answers2

3

You should not change it. I'm pretty sure that value is excluding attachments.

The max document size is just for the JSON part of the document (not your image attachments), and it prevents the server from using too much memory to hold an oversized document.

Also, you may ignore @ajreal, he seems to have no idea what he is saying.

JasonSmith
  • 72,674
  • 22
  • 123
  • 149
  • Thank you! In each document we also have integer and datetime fields. My understanding from your answer is that max_document_size is only used to prevent couchdb from giving memory to documents exceeding the cap. It does not affect how db allocate memory or has no implication on performance for regular documents. Therefore, even my max doc size would be in bytes (the json part), I don't have to mass with the default max_document_size value? – user1212766 Feb 21 '12 at 00:22
3

Assuming you stream the attachment in as standalone (i.e, PUT /dbname/docid/attachment_name) you won't hit the max_document_size limit. Jason is correct that it only limits the size of a JSON body PUT. I also second his opinion that ajreal is talking crap.

Robert Newson
  • 4,631
  • 20
  • 18