theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
111 stars 8 forks source link

Phantomjs topo performance #1670

Open brendanheywood opened 10 years ago

brendanheywood commented 10 years ago
scd commented 10 years ago

$(function(){ ... })

do this:

$(document).on('toposready', function(){ ... })

scd commented 10 years ago

I am away for a week, so it will be a while before I get into this.

Is there anything wrong with having both apache and phantom daemons both working?

Actually this brings up a point that is likely to be a limit of my understanding. With our architecture, can we reroute a www.thecrag.com/topo/1234/png call to the phantom port rather than apache. Maybe this is not even necessary and apache serves normal port and phantom servers another port, which has to be explicitly stated in the url.

Also 100ms may be a bit unreasonable because phantom still calls the standard topo end point, which is not yet optimized to that level yet.

It is certainly worthwhile playing with.

brendanheywood commented 10 years ago

Yeah no rush at all.

Yes we can route it however we want, at least route it in apache land to phantom instead of mod_perl. The phantom port would only ever serve on local host so would not be explicitly stated in the url.

And yes I agree the base call is also too slow, it's currently 500-900ms, but it's also doing a bunch of stuff which isn't needed for the png side (user login, nav menu etc) so maybe we should investigate trimming it down maybe into another endpoint. In fact we could probably remove the endpoint entirely just get node to just pull the data out directly from the db instead of going through mod_perl although this will mean a little code duplication.

So now we have: apache -> mod_perl -> new phantomjs instance -> apache -> mod_perl -> db

but we'd want something like this eventually apache -> phantomjs server -> db

scd commented 10 years ago

Good long term target, with small steps in between On Oct 2, 2014 1:59 PM, "Brendan Heywood" notifications@github.com wrote:

Yeah no rush at all.

Yes we can route it however we want, at least route it in apache land to phantom instead of mod_perl. The phantom port would only ever serve on local host so would not be explicitly stated in the url.

And yes I agree the base call is also too slow, it's currently 500-900ms, but it's also doing a bunch of stuff which isn't needed for the png side (user login, nav menu etc) so maybe we should investigate trimming it down maybe into another endpoint. In fact we could probably remove the endpoint entirely just get node to just pull the data out directly from the db instead of going through mod_perl although this will mean a little code duplication.

So now we have: apache -> mod_perl -> new phantomjs instance -> apache -> mod_perl -> db

but we'd want something like this eventually apache -> phantomjs server -> db

— Reply to this email directly or view it on GitHub https://github.com/theCrag/website/issues/1670#issuecomment-57580008.