Skip to main content

Load testing API, LoadImpact, NewRelic, AWS computing, CPU credit, k6 cli...

https://github.com/loadimpact/k6

Price quite high but understandable compared to another service like BrowserStack, New Relic
https://loadimpact.com/pricing/#annually

Random pop out
https://www.techradar.com/news/captcha-if-you-can-how-youve-been-training-ai-for-years-without-realising-it

https://stackoverflow.com/questions/28984106/what-is-cpu-credit-balance-in-ec2

https://aws.amazon.com/ec2/instance-types/
Compared to DO
smallest 1GB memory, 1CPU (Xeon E520 ? 2.2GHz)

https://www.digitalocean.com/pricing/

k6 (loadimpact cli) seem not limit VUs (virtual user) since it run on client machine, use client resources. So cool. But with 1000 vus, even MBP 2017 seem lagging. Digital Ocean cheapest 5$ seem take a while to ready test with 100 vus

Auto restart
https://forums.aws.amazon.com/thread.jspa?threadID=165405
https://stackoverflow.com/questions/19835455/how-to-restart-node-application-automatically-on-aws-elastic-beanstalk/28986288
My bss suggest use /healthcheck, when it response other than 200 for example then re-init/restart instance ? So what with load balancer ?

virtual-host config or NGINX port for local/dev testing domain.
We can temporary use IP in serve Laravel or php -S (lumen from 5.2 remove serve by default)
php -S 178.122.23.111 -t ./public

remember add /index.php when call API served by php -S
May be php -S have options for auto-index.

https://easyengine.io/tutorials/monitoring/newrelic

With Apache ?
https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/apache-monitoring-integration
Too much config :-'

Lua doc loadimpact
https://loadimpact.com/load-script-api/

Appname Newrelic Beanstalk permanent.
https://stackoverflow.com/questions/49804240/set-newrelic-app-name-from-elb-env-variable-on-deploy

https://gist.github.com/obezuk/7a48ff8233a4aa2ec7dc7b986416647b

.ebextensions/newrelic.config

files:
 "/etc/php.d/newrelicappname.ini" :
  mode: "000644"
  owner: root
  group: root
  content: 'newrelic.appname="Application Name"'
packages:
 yum:
  newrelic-php5: []
  newrelic-sysmond: []
 rpm:
  newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
container_commands:
 newrelic1:
  command: "newrelic-install install"
 newrelic3:
  command: "/usr/sbin/nrsysmond-config --set license_key=$NR_INSTALL_KEY"
 newrelic4:
  command: "/etc/init.d/newrelic-sysmond start"

Some k6 samples
https://github.com/loadimpact/k6/tree/master/samples
Long example look to pantheon purchase test.
Threshold seems cool, can it used to test load without broke API ? For example if more than 5% of request lost/err then stop test ?

Running k6
https://docs.k6.io/docs/running-k6

https://www.mankier.com/1/siege
siege on ELB load balancer seems weird since ELB keep trying create new instance when one is down, too high load...

https://thehftguy.com/2016/10/03/haproxy-vs-nginx-why-you-should-never-use-nginx-for-load-balancing/
Worth a try to build EB stalk with nginx then compare performance / $.
may be CloudFront is good enough but I believe NGINX have something that continue grab apc share.

https://hypersense-software.com/2018/03/12/aws-elastic-beanstalk-nginx-php/


PaperTrail
https://raw.githubusercontent.com/papertrail/remote_syslog2/master/examples/remote_syslog.ebextensions.config
Oh thoughtwork
https://www.thoughtworks.com/mingle/infrastructure/2015/06/10/simple-solution-for-papertrail-on-elasticbeanstalk.html
https://github.com/aldogint/papertrail-laravel
https://forums.aws.amazon.com/message.jspa?messageID=662845

One of my aware is that sometime it seems eb deploy --staged not update change. May be I have to commit or add/staged something or clear cache ...

https://stackoverflow.com/questions/33884150/eb-deploy-staged-usage

https://github.com/moraes/config/issues/1
give a try eb abort  . May be it like k6, we can use it in different terminal tab. Remembering aptible tunnel connection.

Be careful with .yaml and/or .config
[space]. .. and/or tab can cause error.
With vim show number: $:set nu
Show tab character  $:set list
When have error => compare with default example/sample. For example if we have 2 space after first block then you should follow it. I have a couple of hours to figure out this.

2019-01-16 03:43:28    ERROR   The configuration file .ebextensions/04-papertrail.config in application version app-xxx-stage-190116_xxx contains invalid YAML or JSON. YAML exception: Invalid Yaml: while parsing a block mapping
 in "<reader>", line 14, column 3:
      "/etc/log_files.yml":
      ^
expected <block end>, but found BlockMappingStart
 in "<reader>", line 29, column 4:
       "/tmp/set-logger-hostname.sh":
       ^
, JSON exception: Invalid JSON: Unexpected character (#) at position 0.. Update the configuration file.
2019-01-16 03:43:28    ERROR   Failed to deploy application.

https://aws.amazon.com/elasticache/pricing/
https://aws.amazon.com/elasticloadbalancing/pricing/
https://12factor.net/

Determine gzip supported or not
$ curl http://example.com/ --silent --write-out "%{size_download}\n" --output /dev/null
31032
$ curl http://example.com/ --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null
2553

https://github.com/heroku/heroku-buildpack-php/blob/master/support/build/_conf/apache2/httpd.conf

Some load tester
https://geekflare.com/essential-tools-to-perform-stress-test-online/#Blazemeter
:oh blazemeter require JMeter test script. Try make some script in JMeter then export it.
Free seems only allow 50 users.

Error when deploy, this stuck have occur in Aptible too (rare but yes)
https://forums.aws.amazon.com/message.jspa?messageID=705572

2019-01-17 07:40:08    INFO    Environment health has transitioned from Info to Ok. Application update completed 87 seconds ago and took 24 seconds.
2019-01-17 07:42:08    WARN    Environment health has transitioned from Ok to Severe. None of the instances are sending data.
2019-01-17 07:46:16    INFO    Environment update is starting.
2019-01-17 07:46:20    INFO    Deploying new version to instance(s).
2019-01-17 07:53:23    WARN    User initiated abort was received, however the current step of the operation in progress is not cancellable. The current operation will be aborted as soon as the non-cancellable step(s) complete.
2019-01-17 08:00:23    WARN    The following instances have not responded in the allowed command timeout time (they might still finish eventually on their own): [i-xxxxxxxxx98a653a1].
2019-01-17 08:00:23    INFO    Command execution completed on all instances. Summary: [Successful: 0, TimedOut: 1].
2019-01-17 08:00:24    WARN    User initiated abort was received. Canceling the current operation.
2019-01-17 08:00:24    ERROR   Failed to deploy application.
2019-01-17 08:00:24    ERROR   During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.

https://royal.pingdom.com/2018/08/15/can-gzip-compression-really-improve-web-performance/

Yeah
/etc/httpd/conf.d/aws_env.conf
[ec2-user@ip-xxx]$ php -i |grep "output_compression"
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1

/etc/httpd/conf.d/aws_env.conf:42:SetEnv PHP_ZLIB_OUTPUT_COMPRESSION "Off"
It config in beanstalk configuration screen.

https://geeksterminal.com/difference-between-mod-deflate-zlib-output-compression/981/
https://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

https://stackoverflow.com/questions/42400648/aws-whats-the-best-scaling-trigger-for-php-server
https://blog.flux7.com/blogs/aws/must-know-facts-about-aws-elb
https://medium.com/stacktical/how-to-lose-money-with-the-new-aws-elb-network-load-balancer-e87e670c05ea

https://www.opcito.com/blogs/improve-your-load-balancer-performance-with-saltstack-and-nginx-2/

https://forums.aws.amazon.com/message.jspa?messageID=399607
https://sysdig.com/blog/amazon-elb-bug/

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

NGINX tuning
https://gist.github.com/denji/8359866

k6 test stages, step by step increase vus to avoid kill server and may be trigger load balancer
https://github.com/loadimpact/k6/issues/550
http://users.cms.caltech.edu/~adamw/publications-openclosed.html

https://medium.com/nubego/understanding-aws-elastic-load-balancing-62bf3d2cec5f
https://www.webperformance.com/load-testing-tools/blog/2011/01/load-testing-back-to-basics-avoiding-the-keepalivetimeout-race-condition/

Alternative to NGINX + FPM custom on beanstalk.
http://www.mattzuba.com/2014/05/aws-elastic-beanstalk-with-apache-2-4-and-php-fpm-5-5/


https://bobcares.com/blog/apache-high-memory-usage/
What k6 run options for, find out here.
--vus virtual user, should be stages if want to avoid take down server
--duration 300s (s or m ? unit required)
--rqs limit req per s
--stage don't know how to use. => config in .js options stages = {...}
https://github.com/loadimpact/k6/blob/master/README.md

install k6 one paste
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
echo "deb https://dl.bintray.com/loadimpact/deb stable main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install k6

http://jestineyong.com/no-display-in-tv-due-to-eeprom-ic-fault/
CPU credit may be run out, so it seem staging down on same 70+ rps

https://forums.aws.amazon.com/thread.jspa?threadID=129400
https://www.webperformance.com/load-testing-tools/blog/2011/01/load-testing-back-to-basics-avoiding-the-keepalivetimeout-race-condition/

Comments

  1. The content you provided here is written clearly. The content of the information is very informative. Thank you for this excellent and good idea. keep blogging
    Google Cloud Platform Training
    GCP Online Training
    Google Cloud Platform Training In Hyderabad

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

AWS Elasticache Memcached connection

https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/accessing-elasticache.html#access-from-outside-aws http://hourlyapps.blogspot.com/2010/06/examples-of-memcached-commands.html Access memcached https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/GettingStarted.AuthorizeAccess.html Zip include hidden file https://stackoverflow.com/questions/12493206/zip-including-hidden-files phpmemcachedadmin ~ phpMyAdmin or phpPgAdmin ... telnet mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com 11211 stats items stats cachedump 27 100 https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/VPCs.EC.html https://lzone.de/cheat-sheet/memcached VPC ID Security Group ID (sg-...) Cluster: The identifier for the cluster memcached1 Creation Time: The time (UTC) when the cluster was created January 9, 2019 at 11:47:16 AM UTC+7 Configuration Endpoint: The configuration endpoint of the cluster memcached1.ahgofe.cfg.usw1.cache.amazonaws.com:11211 St...

Notes Windows 10 Virtualbox config, PHP Storm Japanese, custom PHP, Apache build, Postgresql

 cmd => Ctrl + Shift + Enter mklink "C:\Users\HauNT\Videos\host3" "C:\Windows\System32\drivers\etc\hosts" https://www.quora.com/How-to-create-a-router-in-php https://serverfault.com/questions/225155/virtualbox-how-to-set-up-networking-so-both-host-and-guest-can-access-internet 1 NAT + 1 host only config https://unix.stackexchange.com/questions/115464/how-to-properly-set-up-2-network-interfaces-in-centos-running-in-virtualbox DEVICE=eth0 TYPE=Ethernet #BOOTPROTO=dhcp BOOTPROTO=none #IPADDR=10.9.11.246 #PREFIX=24 #GATEWAY=10.9.11.1 #IPV4_FAILURE_FATAL=yes #HWADDR=08:00:27:CC:AC:AC ONBOOT=yes NAME="System eth0" [root@localhost www]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 # Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1 IPADDR=192.168.56.28 <= no eff => auto like DHCP #GATEWAY=192.168.56.1 #BOOTPROTO=dhcp BOOTPROTO=static <= no eff ONBOOT=yes HWADDR=08:00:27:b4:20:10 [root@localhost www]# ...

Rocket.Chat DB schema

_raix_push_notifications avatars.chunks avatars.files instances meteor_accounts_loginServiceConfiguration meteor_oauth_pendingCredentials meteor_oauth_pendingRequestTokens migrations rocketchat__trash rocketchat_cron_history rocketchat_custom_emoji rocketchat_custom_sounds rocketchat_import rocketchat_integration_history rocketchat_integrations rocketchat_livechat_custom_field rocketchat_livechat_department rocketchat_livechat_department_agents rocketchat_livechat_external_message rocketchat_livechat_inquiry rocketchat_livechat_office_hour rocketchat_livechat_page_visited rocketchat_livechat_trigger rocketchat_message rocketchat_oauth_apps rocketchat_oembed_cache rocketchat_permissions rocketchat_raw_imports rocketchat_reports rocketchat_roles rocketchat_room rocketchat_settings rocketchat_smarsh_history rocketchat_statistics rocketchat_subscription rocketchat_uploads system.indexes users usersSessions https://rocket.chat/docs/developer-guides/sc...