Open nikolay opened 11 years ago
Any comment? This would nicely optimize even further the downstream caching, which I followed here: https://developers.google.com/speed/pagespeed/module/downstream-caching
Unix socket support would be nice if someone wanted to add it, but I'm not sure it would gain us much. I don't think the main limitation here is communication time between the processes, so avoiding the overhead of TCP/IP shouldn't speed things up much overall. Or am I thinking about this wrong?
I've seen benchmarks on using PHP-FPM on Nginx via TCP/IP and Unix Sockets and that's where I get those 10% improvement - I'm not sure how realistic that would be internally for Nginx, but if you're already serving your site over Unix Sockets and want to implement PageSpeed, you'll be forced to switch to TCP/IP.
I'm playing with deploying nginx + pagespeed onto Heroku for Ruby apps. The Heroku buildpack for nginx uses Unix domain sockets, which I believe would be the only way to get this all working on Heroku.
It'd be really nice to have Unix domain socket support for pagespeed.
@jc00ke Plus the speed benefits.
@jeffkaufman I know for sure that the Native Fetcher cannot fetch over a Unix Domain Socket, but do you think PageSpeed can work on a server served over a domain socket with the Native Fetcher being turned off? I am asking as I have those weird issues with port 8080 I keep reporting and I was thinking if things could be worked around by using the more efficient anyway domain sockets?
@nikolay I think the weird issues you have with 8080 are #656, right? I have a fix for this in PSOL, which should hit trunk-tracking in the next few days and then be in our 1.8 release.
To fetch from a domain socket would you want something like MapOriginDomain
saying "fetch these urls from this socket"? (Actually, this makes me think: perhaps LoadFromFile
should have just been what you got if you did a MapOriginDomain
to a file://
url...)
@jeffkaufman No, the outstanding issue for me is https://github.com/pagespeed/ngx_pagespeed/issues/585, which might be related, but I can't say for sure. I'm using downstream configuration and PageSpeed optimizes port 8080 and the world sees port 80, but I get weird redirects to the proper URL, but at port 8080, which PageSpeed is causing for sure (it started doing this in 1.7.x).
@jeffkaufman So, is it possible now to use file://
with MapOriginDomain
?
@nikolay
is it possible now to use file:// with MapOriginDomain?
Sorry, it's not. That was me speculating about how it could work.
In Nginx, you can make a server listen to a Unix domain socket vs TCP/IP, which could improve performance when you implement the downstream caching with Nginx. Unfortunately, the native fetcher does not support that and, in fact, fails in ParseUrl() without any helpful information (like showing the URL that cannot be parsed, etc.). According to some benchmarks, Unix Domain Sockets can be around 10% faster used locally, so, it would be great if support is added.