Jump to content

Unbelievable results with Varnish


Recommended Posts

Posted

Oh, That's great I thought I saw in your first post that you had to change some php file in the admin folder.

I guess my varnish settings aren't correct yet. (I have sent you a pm with my config). When I go to my web page now, I can see some cookies being set (probably by cloudflare)? Maybe my cookies aren't being unset correctly?

My web page for reference (http://www.l2p.be).

  • Replies 202
  • Created
  • Last Reply
Posted

No offense, but you came here for help on a varnish config.. took absolutely nobody's advice on how to get it working properly (and thus have none of your own real-world benchmarks to compare to), and now are suggesting alternatives? Cached compiled php scripts (opcode caches) are not the same as what Varnish does. If you want to suggest alternatives start another thread please.



Facebook, Twitter, The New York Times, WikiPedia, WikiMedia, Globo, The Hindu, NBC Universal Bravo TV, The Grammy Awards and Data.gov.uk are some of the major organizations using Varnish.. it might be possible that they don't all collectively have a bunch of idiot sysadmins running their show.


ok thank you for the list. Now that you've gotten that off your chest... back on topic now. :baby:
Posted

Just an update:

I have temporarily disabled cloudflare and now images are showing as hit's, so that's great!

But my index pages keeps showing up as a miss, is this the expected behaviour we are going for or am I still doing something wrong. I would expect that if I'm not logged in everything is cached.

Posted

It seems ip.board always sets a session_id cookie, so pages never get cached. I'm amazed you get anything cached... I must be doing something wrong...

  • 1 month later...
Posted

It seems ip.board always sets a session_id cookie, so pages never get cached. I'm amazed you get anything cached... I must be doing something wrong...




yes im now wondering how varnish can increase the page load speed if the member is logged in ???
Posted

That is not the scope of this implementation but can be accomplished with ESI. I am still struggling to get varnish too work when a user isn't logged in. Even if you are not logged in IPB sets a cookie.

Posted

yes im now wondering how varnish can increase the page load speed if the member is logged in ???



Directly: It will serve static content such as images faster than apache.
Indirectly: It lowers the overall requirements. So, the hardware would be more available to serve your members immediately.
Both of these effects are significant.

so there is no meaning in seting up varnish on a IPB site :smile:



Partly, I agree. Varnish's main purpose is to cache html. HTML cannot be cached and caching will only slow things further if requirements are 100% dynamic (which is the very nature of a forum). Varnish is awesome when the read to write ratio is very high. For example, if a post in wordpress is made, it may be seen 1000 times before another edit -- or never edited again. There are no tracking of what guests have done by browsing. This would be ideal for varnish. If a new post in the forum is made, it may be seen only a few times before someone makes a reply. To top it off, it may show different result depending on the member as mods needs to see moderation buttons and such. It also needs to show different results per person based on things like read post/unread post, etc. This would not be an ideal situation for varnish.

Admittedly, I did not read all 7 pages of this post and I'm not sure how the OP or the followers have setup their systems. But, caching http for guests will prevent guest tracking as they're only served cached content. If this bypass was given, varnish would be doing nothing but serving static content and making useless caches that misses 100% of the time -- which would be better done with something like nginx.
Posted

Hello,

My setup just caches html content generated from backend (apache+php) server for guests.
There is no point to cache content for members since each other has it's own setting and this doesn't make any sense.
For serving static content, i use nginx because it's fast and there is no point serving images from memory using varnish because reading static content with a webserver is not a heavy task.

  • 3 weeks later...
  • 4 weeks later...
Posted

I mean one configuration which allows topic views update without ESI? As it seems now, the varnish configs would have problem not only with topic view, but also the board totals: amount of guests oline

Talking about this config http://community.invisionpower.com/topic/328398-unbelievable-results-with-varnish/page__st__100#entry2195883

  • 2 weeks later...
Posted

I wish I could remember where I saw this, but I've seem some tests where varnish isn't really any faster then nginx at serving static content. With that in mind, and with all the difficulties involved in setting up varnish, is it really worth it?

  • 1 month later...
Posted

I'm setting up on the new server a setup with varnish (3.0.2) in front of nginx (1.1.18) with fastcgi

I did read al the thead and I did try the suggested config

but I have some issue

online users is not working
if I try to modify any post the editor will not close
i can't upload images

any suggestion will be apreciated

Posted

I'm setting up on the new server a setup with varnish (3.0.2) in front of nginx (1.1.18) with fastcgi



I did read al the thead and I did try the suggested config



but I have some issue



online users is not working


if I try to modify any post the editor will not close


i can't upload images



any suggestion will be apreciated



Well, clearly you either didn't read my post in this thread, or chose to ignore it.

Online users is not working because you've set yourself a reverse proxy. You need to configure the reverse proxy so that the proper IPs are passed into proper fields. Otherwise, everything will appear as if the connection is going from and to localhost.

Your setup of varnish in front and nginx in the back is completely redundant, useless, introducing complications and wasting of resources. Just remove varnish entirely.
  • 2 weeks later...
Posted

I'm really interested in trying out Varnish... but all the fantastic advice, various configurations, etc. makes things a bit confusing!

So, to go back to Ambar's config based on mat206's (which I'm looking at mainly because we have Google Analytics as well) ...

Am I understanding right that that is basically it? Install Varnish, get it set up, and using that config -- no modifications to core code or even templates needed?

Posted

be careful, IIRC those settings will not work on newer varnish versions and you will need to change a few lines...but i might be wrong, just test, if you need to make changes they are easy to google ;)

Posted

Varnish seems to update quite a lot!

But is the basic question still sound -- that the linked config (updated to work with the latest Varnish) will cache pages without needing to modify any templates?

  • 3 weeks later...
Posted

We are looking at using Varnish, so thanks for all the info. One question though, did any of you consider/implement what Nuno mentioned here?



So if I understand correctly, the current configs on this page would give guests semi-stale content that would only refresh every X seconds correct? If we implemented the changes Nuno proposed everyone would see the most recent content, the only downside is potentially the cache is being flushed relatively often?

Any insight would be appreciated, I will try to implement this on my site sometime this week.

Posted

I used settings from Ambar (modified version of mat206) as base for a server of ours. The code change is I added varnish to pass through for mobile users as well (somehow one of the mobile pages got cached, so it's removed to be safe). Also removed the ability to change themes for guests since it doesn't work and may be a source of confusion.

The forum is publicly accessible by guests so the main reason was to have guests read from a semi-stale cache and leave resources for our logged in members only.

There were no reported problems with Varnish 3.0.2. Varnish passes requests back to a nginx/fpm/xcache backend. We have the realIP module compiled in nginx.

To do list would be to look at doing this with fcgicache in nginx or using varnish to cache logged in users as well (with some sort of purge). First step is going to be looking at .Nuno.'s config settings as it seems like the right stuff!

Posted

To do list would be to look at doing this with fcgicache in nginx or using varnish to cache logged in users as well (with some sort of purge). First step is going to be looking at .Nuno.'s config settings as it seems like the right stuff!




You have more info here:

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...