T
T
tamtakoe2020-10-18 20:07:06
Load balancing
tamtakoe, 2020-10-18 20:07:06

What simple web servers do you know for testing the balancer?

We need a server under Linux that would randomly display information about the request and about its instance (hostname, url, ip) or an error. Preferably without external dependencies (for example, node.js) and with a simple config

If there is nothing like this out of the box, please write how to do it in Python, nginx, bash or something else to compare which is easier. Perhaps there is test software designed for this. Which?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tamtakoe, 2020-10-19
@tamtakoe

For example, a simple bash server that returns the server ip for any request

body=$(hostname -I)
while true
  do printf 'HTTP/1.0 200 OK\r\nContent-Length: %d\r\n\r\n%s' "${#body}" "${body}\r\n" | nc -l 8080
done

Judging by the activity of the respondents, it was necessary to put the question on the "Difficult" level

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question