Varnish - multiple backends for one siteMultiple PHP Versions / cPanel with mod_fcgidHow would I run Django and LAMP on different subdomains, but on the same Apache server?Running two instances of Apache as separate users — permission deniedDebian, Apache, mod_userdir, suexec, php-cgiWrong site appears in Nginxvarnishd killed by OOM, How can I configure the varnishd to avoid this problem?How to avoid repeating sed commands when adding sites to Varnish?Apache PHP uploads - ownership and permissionsHow to connect PHP 5.6 to SQL db after compilationRunning Multiple Versions of PHP Using Apache on Gentoo
What are these boxed doors outside store fronts in New York?
I see my dog run
I probably found a bug with the sudo apt install function
Patience, young "Padovan"
What would the Romans have called "sorcery"?
What is the meaning of "of trouble" in the following sentence?
Download, install and reboot computer at night if needed
DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?
Can I make popcorn with any corn?
Is Social Media Science Fiction?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
How to calculate implied correlation via observed market price (Margrabe option)
Why is the design of haulage companies so “special”?
Draw simple lines in Inkscape
Can Medicine checks be used, with decent rolls, to completely mitigate the risk of death from ongoing damage?
How to make payment on the internet without leaving a money trail?
What makes Graph invariants so useful/important?
Is it possible to do 50 km distance without any previous training?
Modification to Chariots for Heavy Cavalry Analogue for 4-armed race
Concept of linear mappings are confusing me
What typically incentivizes a professor to change jobs to a lower ranking university?
Is it possible to make sharp wind that can cut stuff from afar?
Can I interfere when another PC is about to be attacked?
XeLaTeX and pdfLaTeX ignore hyphenation
Varnish - multiple backends for one site
Multiple PHP Versions / cPanel with mod_fcgidHow would I run Django and LAMP on different subdomains, but on the same Apache server?Running two instances of Apache as separate users — permission deniedDebian, Apache, mod_userdir, suexec, php-cgiWrong site appears in Nginxvarnishd killed by OOM, How can I configure the varnishd to avoid this problem?How to avoid repeating sed commands when adding sites to Varnish?Apache PHP uploads - ownership and permissionsHow to connect PHP 5.6 to SQL db after compilationRunning Multiple Versions of PHP Using Apache on Gentoo
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Is possible with Varnish configure multiple backends for one site? For example I have high avalibility site with multiple backends.
For example I have site www.goodies.com
which is running on php 5.6. So I have 3 www-nodes
as backend www-node5.6a
www-node5.6b
www-node5.6c
I have configured backends in Varnish like this:
backend www-node5.6a
.host = "10.0.0.11";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6b
.host = "10.0.0.12";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6c
.host = "10.0.0.13";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
my question is, how to configure Varnish so user will be randomly use to any of this backends for this specific one site?
debian apache-httpd varnish
add a comment |
Is possible with Varnish configure multiple backends for one site? For example I have high avalibility site with multiple backends.
For example I have site www.goodies.com
which is running on php 5.6. So I have 3 www-nodes
as backend www-node5.6a
www-node5.6b
www-node5.6c
I have configured backends in Varnish like this:
backend www-node5.6a
.host = "10.0.0.11";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6b
.host = "10.0.0.12";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6c
.host = "10.0.0.13";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
my question is, how to configure Varnish so user will be randomly use to any of this backends for this specific one site?
debian apache-httpd varnish
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08
add a comment |
Is possible with Varnish configure multiple backends for one site? For example I have high avalibility site with multiple backends.
For example I have site www.goodies.com
which is running on php 5.6. So I have 3 www-nodes
as backend www-node5.6a
www-node5.6b
www-node5.6c
I have configured backends in Varnish like this:
backend www-node5.6a
.host = "10.0.0.11";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6b
.host = "10.0.0.12";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6c
.host = "10.0.0.13";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
my question is, how to configure Varnish so user will be randomly use to any of this backends for this specific one site?
debian apache-httpd varnish
Is possible with Varnish configure multiple backends for one site? For example I have high avalibility site with multiple backends.
For example I have site www.goodies.com
which is running on php 5.6. So I have 3 www-nodes
as backend www-node5.6a
www-node5.6b
www-node5.6c
I have configured backends in Varnish like this:
backend www-node5.6a
.host = "10.0.0.11";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6b
.host = "10.0.0.12";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
backend www-node5.6c
.host = "10.0.0.13";
.port = "80";
.connect_timeout = 6000s;
.first_byte_timeout = 6000s;
.between_bytes_timeout = 6000s;
my question is, how to configure Varnish so user will be randomly use to any of this backends for this specific one site?
debian apache-httpd varnish
debian apache-httpd varnish
asked Mar 27 at 14:48
DeliriumDelirium
74111
74111
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08
add a comment |
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08
add a comment |
1 Answer
1
active
oldest
votes
What you are looking for if you want random distribution of the content you need something like this in your config file:
director cl1 random
.backend = [Backend0]; .weight = 1;
.backend = [Backend1]; .weight = 1;
More information about how Varnish backends work can be found here. I found the above snippet from this blog. You can also do this on the basis of url, as seen here. You can also read more on configuring Varnish for High Availability here.
You should consider doing health checks and setting up and defining an actual director in round robin mode. Random is random. In theory, every single user that visits your site could be randomly sent to the same backend and that would be just as "random" as splitting things evenly based on backend health and status. Looking to another source they have something along these lines:
import directors;
backend [Backend0]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
backend [Backend1]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
sub vcl_init
new vdir = directors.round_robin();
vdir.add_backend([Backend0]);
vdir.add_backend([Backend1]);
Make the changes as necessary for what makes sense in your environment. Please read over all the links and documentation as well as make a backup of your old configuration before trying any of this.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f509009%2fvarnish-multiple-backends-for-one-site%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you are looking for if you want random distribution of the content you need something like this in your config file:
director cl1 random
.backend = [Backend0]; .weight = 1;
.backend = [Backend1]; .weight = 1;
More information about how Varnish backends work can be found here. I found the above snippet from this blog. You can also do this on the basis of url, as seen here. You can also read more on configuring Varnish for High Availability here.
You should consider doing health checks and setting up and defining an actual director in round robin mode. Random is random. In theory, every single user that visits your site could be randomly sent to the same backend and that would be just as "random" as splitting things evenly based on backend health and status. Looking to another source they have something along these lines:
import directors;
backend [Backend0]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
backend [Backend1]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
sub vcl_init
new vdir = directors.round_robin();
vdir.add_backend([Backend0]);
vdir.add_backend([Backend1]);
Make the changes as necessary for what makes sense in your environment. Please read over all the links and documentation as well as make a backup of your old configuration before trying any of this.
add a comment |
What you are looking for if you want random distribution of the content you need something like this in your config file:
director cl1 random
.backend = [Backend0]; .weight = 1;
.backend = [Backend1]; .weight = 1;
More information about how Varnish backends work can be found here. I found the above snippet from this blog. You can also do this on the basis of url, as seen here. You can also read more on configuring Varnish for High Availability here.
You should consider doing health checks and setting up and defining an actual director in round robin mode. Random is random. In theory, every single user that visits your site could be randomly sent to the same backend and that would be just as "random" as splitting things evenly based on backend health and status. Looking to another source they have something along these lines:
import directors;
backend [Backend0]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
backend [Backend1]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
sub vcl_init
new vdir = directors.round_robin();
vdir.add_backend([Backend0]);
vdir.add_backend([Backend1]);
Make the changes as necessary for what makes sense in your environment. Please read over all the links and documentation as well as make a backup of your old configuration before trying any of this.
add a comment |
What you are looking for if you want random distribution of the content you need something like this in your config file:
director cl1 random
.backend = [Backend0]; .weight = 1;
.backend = [Backend1]; .weight = 1;
More information about how Varnish backends work can be found here. I found the above snippet from this blog. You can also do this on the basis of url, as seen here. You can also read more on configuring Varnish for High Availability here.
You should consider doing health checks and setting up and defining an actual director in round robin mode. Random is random. In theory, every single user that visits your site could be randomly sent to the same backend and that would be just as "random" as splitting things evenly based on backend health and status. Looking to another source they have something along these lines:
import directors;
backend [Backend0]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
backend [Backend1]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
sub vcl_init
new vdir = directors.round_robin();
vdir.add_backend([Backend0]);
vdir.add_backend([Backend1]);
Make the changes as necessary for what makes sense in your environment. Please read over all the links and documentation as well as make a backup of your old configuration before trying any of this.
What you are looking for if you want random distribution of the content you need something like this in your config file:
director cl1 random
.backend = [Backend0]; .weight = 1;
.backend = [Backend1]; .weight = 1;
More information about how Varnish backends work can be found here. I found the above snippet from this blog. You can also do this on the basis of url, as seen here. You can also read more on configuring Varnish for High Availability here.
You should consider doing health checks and setting up and defining an actual director in round robin mode. Random is random. In theory, every single user that visits your site could be randomly sent to the same backend and that would be just as "random" as splitting things evenly based on backend health and status. Looking to another source they have something along these lines:
import directors;
backend [Backend0]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
backend [Backend1]
.host = "192.168.0.10";
.probe =
.url = "/";
.timeout = 1s;
.interval = 5s;
.window = 5;
.threshold = 3;
sub vcl_init
new vdir = directors.round_robin();
vdir.add_backend([Backend0]);
vdir.add_backend([Backend1]);
Make the changes as necessary for what makes sense in your environment. Please read over all the links and documentation as well as make a backup of your old configuration before trying any of this.
answered Mar 27 at 15:38
kemotepkemotep
2,6983823
2,6983823
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f509009%2fvarnish-multiple-backends-for-one-site%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
-apache-httpd, debian, varnish
Googling for "varnish load balancing" serves up plenty of examples. BTW, 6000 seconds timeout for connect?! And the rest...
– wurtel
Mar 27 at 15:08
Actually no, just wanted to make it more simple. There is the only reason so if there will be high traffic so the www-node will not crash.
– Delirium
Mar 27 at 15:08