spoiler alert: auto scaling is far to be magical
as usual with aws, everything is an object and for autoscaling u got several objects and several links between them
First you define a launch configuration : what type of machine you want to laucnh
Then an autoscaling group : it will use the launch configuration to create new EC2
In this autoscaling group, you have to define auto scaling policies ie what to do (remove or add x instances) and link them to a cloudwatch alert (cpu is high or network or whatever cloudwatch monitors)
the autoscaling group can also be linked to an ELB so when EC2 are added/removed, they also are registred/deregistered from ELB
-
https://links.infomee.fr/?JIGagwA lot of work to do..
Example : I change the autoscaling trigger in web UI interface. After a few second, my autoscaling trigger is changed (checked).
But if I save beanstalk environment configuration into a file, the change I made is not there :-(
Maybe working wih UI is not the best option, but it's very convenient to test stuff without terminate/recreate env from scratch (things I have to do btw when I commit changes in files, I have to check if the behaviour is the same)
A lot of time lost, but it's the price to have reproductible environment and 'infrastructure as a code'
-
https://links.infomee.fr/?5sq-xQEach time you start a stopped instance we charge a full instance hour, even if you make this transition multiple times within a single hour.
-
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.htmlI'm happy with vimdiff (colorscheme Murphy) but why not!
-
http://blog.owen.cymru/github-style-diff-in-terminal-with-icdiff/Elastic Beanstalk simplifies this process by managing the Amazon SQS queue and running a daemon process on each instance that reads from the queue for you. When the daemon pulls an item from the queue, it sends an HTTP POST request locally to http://localhost/ with the contents of the queue message in the body. All that your application needs to do is perform the long-running task in response to the POST. You can configure the daemon to post to a different path, use a MIME type other than application/JSON, connect to an existing queue, or customize connections, timeouts, and retries.
-
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.htmlCycle de vie des messages Amazon SQS
Les messages stockés dans Amazon SQS ont un cycle de vie facile à gérer, mais qui garantit le traitement de tous les messages.
Un système qui doit envoyer un message sélectionne une file d'attente Amazon SQS et utilise SendMessage pour lui envoyer un nouveau message.
Un autre système traitant des messages doit traiter plus de messages : il appelle donc ReceiveMessage, et ce message est renvoyé.
Dès lors qu'un message est renvoyé par ReceiveMessage, il ne sera pas renvoyé par une autre demande ReceiveMessage avant que le délai de visibilité ne soit expiré. Ainsi, plusieurs destinataires peuvent traiter le même message simultanément.
Si le système de traitement des messages termine avec succès le traitement de ce message, il appelle DeleteMessage, ce qui supprime le message de la file d'attente pour que personne d'autre ne le traite. Si ce système ne réussit pas à traiter le message, il sera alors lu par un autre appel ReceiveMessage dès que le délai de visibilité sera expiré.
Si vous avez associé une file d'attente de lettre morte à une file d'attente source, les messages seront déplacés vers la file d'attente de lettre morte lorsque le nombre de tentatives d'envoi que vous avez défini aura été atteint.
-
https://aws.amazon.com/fr/sqs/details/Running Bottle with a different server
As said above, the standard server is perfectly suitable for development, personal use or a small group of people only using your application based on Bottle. For larger tasks, the standard server may become a bottleneck, as it is single-threaded, thus it can only serve one request at a time.
But Bottle has already various adapters to multi-threaded servers on board, which perform better on higher load. Bottle supports Cherrypy, Fapws3, Flup and Paste.
If you want to run for example Bottle with the Paste server, use the following code:
from bottle import PasteServer
...
run(server=PasteServer)
This works exactly the same way with FlupServer, CherryPyServer and FapwsServer.
-
https://bottlepy.org/docs/stable/tutorial_app.html#server-setupimport logging
logging.basicConfig(filename='log.txt', format=logging.BASIC_FORMAT)
logging.error('OH NO!')
try:
raise Exception('Foo')
except:
logging.exception("Oops:")
-
http://stackoverflow.com/questions/15444695/how-to-log-into-a-file-for-a-python-bottle-web-serverToday I got a docker daemon not responding to commands (docker ps, docker run...)
Even after restarting service
In /var/log/docker I got this:
time="2017-03-01T08:28:58.43946917Z" level=fatal msg="open /var/run/docker/libcontainerd/containerd/81623262351dfc42c5e87aa8df11592a57f2d14a468476620c7c4d6c89de1958/state.json: no such file or directory"
The solution was to stop docker service, remove this /var/run/docker directory and restart docker service
-
https://links.infomee.fr/?vywQIwBeanstalk ne permet pas de définir un trigger basé sur le nombre d'éléments dans la queue SQS pour l'auto scaling des environements de type worker
Pourtant c'est possible mais il y a un peu de boulot :
http://docs.aws.amazon.com/autoscaling/latest/userguide/as-using-sqs-queue.html
https://forums.aws.amazon.com/thread.jspa?messageID=722589
On peut surement intégrer ça à beanstalk avec les .ebextensions (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html)
En plus d'être un peu complexe et pas vraiment intégrer à beanstalk, ça n'a pas l'air très réactif, cet article en parle et donne une solution :
Rapid Auto Scaling with Amazon SQS : https://aws.amazon.com/blogs/aws/auto-scaling-with-sqs/
-
http://docs.aws.amazon.com/autoscaling/latest/userguide/as-using-sqs-queue.htmlOr "how to search text in git diff history"
git log -p -S "string"
-
http://www.philandstuff.com/2014/02/09/git-pickaxe.htmlDepuis hier le 22 Février 2017
seems cool and powerful
-
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html
-
https://links.infomee.fr/?bERNcgSince December 22th 2016 you are able to configure application version lifecycle in Beanstalk.
Very convenient, we can trash our custom api cleaning scripts :-)
-
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-lifecycle.htmlDefault listener (80) is enabled by default, to disable it :
aws:elb:listener:
ListenerEnabled: false
-
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elblistener