1

We created a deployment pipeline to deploy our web-site to remote servers.

We used psexec.exe to control iis remotely. This works fine.

I will explain our load balancer logic.

We are hosting our web-site after a load balancer. Load balancer looks every server and reads a text file. If text file includes "abc" it sends requests to that server. If text file includes something different it doesn't send.

I seperated my servers virtually. I always have half running servers.

I follow these steps to in first part to copy new code to web-site:

  1. Change load balancer file content to something different ex:"cde"
  2. Wait 15 seconds
  3. PsExec.exe stop site (I'm having 404 errors now)
  4. PsExec.exe stop apppool
  5. Wait 15 seconds
  6. Copy new files to site folder
  7. PsExec.exe start apppool
  8. PsExec.exe start site (No 404 Errors any more)
  9. Wait 5 seconds
  10. Change load balancer file content to "abc"

When i stop the web-site, load balancer can't read the file and sends requests to closed site and it gives 404 ERROR, until the opening web-site!

My question is:

  • Do we need to stop site to copy new files?
  • What is the difference between stopping app-pool and stopping-site while copying files?
  • If i need to stop site, do you have any suggestion to load balancer requests?

Thank you.

ibrahimozgon
  • 1,137
  • 1
  • 12
  • 19
  • If you have multiple servers in your load balancer, a common approach is to drain half of the servers. Wait a window of time for the existing requests to process (let's say 60 seconds). Stop the app-pool / site. Deploy to the half of the servers. Undrain those servers and drain the second half. Then Stop, deploy, undrain the second half. That way you aren't deploying to 'in use' web servers (since that is not a good idea). – mjwills Oct 12 '17 at 12:29
  • I'm doing exactly what you say. I seperated my servers virtually. I first deploy first half, and after everything is ok,i open them to take requests. After that i close second half. I think my real problem is load balancer. It needs web-site file.(For ex: https:10.10.10.20/abc.html) When i stop app pool and site it cant reach this file on site. – ibrahimozgon Oct 12 '17 at 12:54
  • So? Change your process to not expect the file to be there. – mason Oct 12 '17 at 13:37
  • Thank yo @mason. i will try to change that process. If we return the question, do i really need to stop web-site to copy new files or stopping app pool is enough? – ibrahimozgon Oct 12 '17 at 20:38
  • 1
    `do i really need to stop web-site to copy new files or stopping app pool is enough?` Either should be fine. – mjwills Oct 12 '17 at 22:24
  • 1
    I've experienced errors before without doing both. I'd do both just to be safe. – mason Oct 12 '17 at 22:41
  • Thank you very much for your helps.I will try to change file location or port something else. Thanks. – ibrahimozgon Oct 13 '17 at 07:19

0 Answers0