nexcess / magento-turpentine

A Varnish extension for Magento.
GNU General Public License v2.0
520 stars 252 forks source link

Varnish 4.0 Support #498

Closed aheadley closed 9 years ago

aheadley commented 10 years ago

Varnish 4.0 has been released, need to add support for it.

https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html

srmobile commented 9 years ago

I've removed Varnish in favor of another FPC, was easier to implement. It's too bad. Thanks for the previous version, that worked like a charm.

eth8505 commented 9 years ago

@srmobile if you get it configured properly, it's really a nice thing to have, and it IS faster than other FPCs. Too bad you removed it. @zewolf: Did you restart your varnishd after changing the settings? If so, you might want to connect to your varnish instance CLI using varnishadm your parameters are actually changed within the varnish instance. You can use param.show -l to list all values or use param.show cli_buffer to check the value set for the cli_buffer param. This might not be 100% correct since I don't currently have the time to properly check the docs, just wanted to point you in the right direction before leaving for the newyears party :D

zewolf commented 9 years ago

Yes I already check it, the parameter is correct...

Cyril

2014-12-31 17:09 GMT+01:00 Jan-Simon Winkelmann notifications@github.com:

@srmobile https://github.com/srmobile if you get it configured properly, it's really a nice thing to have, and it IS faster than other FPCs. Too bad you removed it. @zewolf https://github.com/zewolf: Did you restart your varnishd after changing the settings? If so, you might want to connect to your varnish instance CLI using varnishadm your parameters are actually changed within the varnish instance. You can use param.show -l to list all values or use param.show cli_buffer to check the value set for the cli_buffer param. This might not be 100% correct since I don't currently have the time to properly check the docs, just wanted to point you in the right direction before leaving for the newyears party :D

— Reply to this email directly or view it on GitHub https://github.com/nexcess/magento-turpentine/issues/498#issuecomment-68450917 .

anderow commented 9 years ago

I have a very similar issue with Varnish 4 and turpentine. I have changed the cli_buffer in varnish.params file but when I use varnishadm it shows as being 8k. So when I change it in varnishadm to the correct value, it appears ok at the time but it doesnt actually change the value , it still remains at 8k?

Really strange....

prysie commented 9 years ago

There is a bug with the regex pattern matching in the file /app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin/Socket.php, to fix change this :

if ( $this->getVersion()==='4.0' ) { // Varnish4 supports "16k" style notation $regexp = '~^cli_buffer\s+Value is:\s+(\d+)([k|m|g]{1})?\s+[bytes]~'; }

To include the b for bytes :

if ( $this->getVersion()==='4.0' ) { // Varnish4 supports "16k" style notation $regexp = '~^cli_buffer\s+Value is:\s+(\d+)([k|m|g|b]{1})?\s+[bytes]~'; }

No need to add it to the pow factor array it as it is already in bytes.

Currently it does not match on the returned message from Varnish that may look like :

200|cli_buffer Value is: 17000b [bytes] Default is: 8k Minimum is: 4k

It can not match on the b so it falls back to using the default const value:

const CLI_CMD_LENGTH_LIMIT = 8192;

Which is usually too small for the vcl generated.

This will fix this issue, on to the next.

Krapulat commented 9 years ago

@aricwatson @miguelbalparda are you planning to include varnish 4 support?

aricwatson commented 9 years ago

Yes, we certainly are! I've already done some testing of the Varnish4 PR and it's looking pretty good although I did see some issues.

aricwatson commented 9 years ago

FYI the devel-varnish4 branch is currently up to date with devel if you'd like to test varnish4 and more recent turpentine features. So far everything is working pretty well in my testing.

csdougliss commented 9 years ago

@aricwatson I'm just testing this now and found a small error when saving your varnish settings:

Fatal error: Call to undefined method Nexcessnet_Turpentine_Helper_Debug::logWarning() in /Users/ccarnell/Sites/dirtdevil-de/app/code/community/Nexcessnet/Turpentine/Model/Varnish/Admin.php on line 172

Should be logWarn

aricwatson commented 9 years ago

Fixed! Thanks!

kirmorozov commented 9 years ago

I had trouble with compiling c include, varnish did not recognize source annotation. Also there was trouble with missing file in modman when install through composer. (about a week ago)

miguelbalparda commented 9 years ago

About the composer stuff, it should be fixed by now. Sorry about that @kirmorozov.

aricwatson commented 9 years ago

@kirmorozov can you give us steps to reproduce?

Krapulat commented 9 years ago

I'm testing varnish 4. With "Use VCL fix" enabled it generates this in vcl file:

if (!false || req.http.Authorization ||
req.method !~ "^(GET|HEAD|OPTIONS)$" ||
req.http.Cookie ~ "varnish_bypass=1") {
return (pipe);
}

I think it could be:

if (!true || req.http.Authorization ||
req.method !~ "^(GET|HEAD|OPTIONS)$" ||
req.http.Cookie ~ "varnish_bypass=1") {
return (pipe);
}
Krapulat commented 9 years ago

Also, it doesn't work with SSL sites.

This resolved the issue: https://github.com/eth8505/magento-turpentine/commit/575f499382217f0013eaf097fd79ceddec0b4381

aricwatson commented 9 years ago

Thanks @Krapulat we'll investigate.

aricwatson commented 9 years ago

Thanks @Krapulat - I couldn't replicate your error in the vcl file, I'm getting the file generated with this when I have 'use vcl fix' enabled:

if (!true || req.http.Authorization ||
req.method !~ "^(GET|HEAD|OPTIONS)$" ||
req.http.Cookie ~ "varnish_bypass=1") {
return (pipe);
}

Which is correct.

As for the ssl fix, I think once we get varnish 4 support merged in, we'll then merge in the https/http fix.

aricwatson commented 9 years ago

We've merged varnish4 support into devel - https://github.com/nexcess/magento-turpentine/pull/883

allardhoeve commented 9 years ago

Are there plans to release this anytime soon?

miguelbalparda commented 9 years ago

This is already released on devel. You can checkout the branch and test the code. We use the devel branch as a release candidate before pushing the code to master.

allardhoeve commented 9 years ago

I understand. My customers would be loath to install from github/devel though. Turpentine is currently the plugin we ask our customers to install at my hosting company, so. It would be nice to be able to offer Varnish 4.

Any idea on when you'll make a new release?

miguelbalparda commented 9 years ago

No, there is no release date for this. We consider that the best way to test this new features is to leave it in devel and have different users test the code. If after a couple of weeks no issues arises we push the new code to master. What I can give you is Magento Connect compatible file with the content of devel branch for you and your customers to install it manually via Connect. Let me know what do you think.

allardhoeve commented 9 years ago

If they could install it through Magento Connect, that would certainly help with the adoption rate :smile:

miguelbalparda commented 9 years ago

Here it is, a Magento Connect file for devel branch. https://mega.nz/#!AR5n0QAb!yFmpGOfl9bzvGfaSHJcFXAtvSFzFhrAHe61EdccusMY

allardhoeve commented 9 years ago

Thanks! But that link tries to convince me to install mega.nz software, which of course I won't :smile:

On Tue, Aug 18, 2015 at 1:50 PM Miguel Balparda notifications@github.com wrote:

Here it is, a Magento Connect file for devel branch. https://mega.nz/#!AR5n0QAb!yFmpGOfl9bzvGfaSHJcFXAtvSFzFhrAHe61EdccusMY

— Reply to this email directly or view it on GitHub https://github.com/nexcess/magento-turpentine/issues/498#issuecomment-132185107 .

miguelbalparda commented 9 years ago

You should be able to use the button that says 'Download through your browser' without installing additional software.

allardhoeve commented 9 years ago

Thanks, clicked the spam by accident :disappointed:

allardhoeve commented 9 years ago

I put it here for future reference:

https://gist.github.com/allardhoeve/095ef50e6a0f2d62ebb8