Interlude. Meteor Under Load
The PDF storage prototype, put together over a weekend, worked flawlessly on my laptop. The tests passed, documents uploaded, and on the phone through Cordova everything looked the same as in the browser. The difficulties began when people arrived, and almost all of them were built the same way: what Meteor did for me inside one process stopped being free as soon as there were more processes or more users.
We had to start with the database. Tailing the MongoDB log, discussed in the fourteenth chapter, works only with a replica set. The database keeps the operation log in order to copy data between its servers, and a standalone server simply does not write it. Without a replica set Meteor silently fell back to polling every ten seconds, and the only way to find out was that the server started to slow down under load. So even a small production database was brought up as a replica set, if only of one node.
Then there was more than one server, and it turned out you could not simply put them behind a load balancer. If the browser failed to open a WebSocket and SockJS fell back to long polling, every subsequent request from that client had to reach the same server where its session lived, otherwise the server would not recognize the client. The load balancer had to be configured so that each client always reached its own server, and as a result the load was spread less evenly than one would like.
Gratis, solo falta un paso
El resto del libro es gratis
Deja tu correo y te mando un enlace para confirmarlo. Después del clic, todos los capítulos se abren aquí, en este dispositivo, durante un año. Cuando salga un libro nuevo, escribiré a esa dirección; responde “basta” a cualquier correo y no vuelvo a escribir.
¿Tienes cuenta INITE? Entra y el libro se abre sin correo.
No se cobra nada por el libro. Si quieres apoyarlo, puedes donar desde cualquier capítulo.
Cómo se guarda la dirección