This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ec2-user@ip-172-31-1-221 ~]$ sudo yum install nginx | |
Loaded plugins: priorities, update-motd, upgrade-helper | |
amzn-main | 2.1 kB 00:00:00 | |
amzn-updates | 2.5 kB 00:00:00 | |
Resolving Dependencies | |
--> Running transaction check | |
---> Package nginx.x86_64 1:1.12.1-1.33.amzn1 will be installed | |
--> Processing Dependency: libprofiler.so.0()(64bit) for package: 1:nginx-1.12.1-1.33.amzn1.x86_64 | |
--> Running transaction check | |
---> Package gperftools-libs.x86_64 0:2.0-11.5.amzn1 will be installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ec2-user@ip-172-31-1-221 ~]$ sudo yum install nginx | |
Loaded plugins: priorities, update-motd, upgrade-helper | |
Could not retrieve mirrorlist http://repo.us-east-2.amazonaws.com/latest/main/mirror.list error was | |
12: Timeout on http://repo.us-east-2.amazonaws.com/latest/main/mirror.list: (28, 'Connection timed out after 5000 milliseconds') | |
http://packages.us-east-1.amazonaws.com/2018.03/main/c31535f74c6e/x86_64/repodata/repomd.xml?instance_id=i-0b48b031c3318d644®ion=us-east-2: [Errno 12] Timeout on http://packages.us-east-1.amazonaws.com/2018.03/main/c31535f74c6e/x86_64/repodata/repomd.xml?instance_id=i-0b48b031c3318d644®ion=us-east-2: (28, 'Connection timed out after 5000 milliseconds') | |
Trying other mirror. | |
^C | |
Current download cancelled, interrupt (ctrl-c) again within two seconds | |
to exit. | |
^C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wrk -t12 -c400 -d10s http://13.59.138.186:8080/product/280 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wrk -t12 -c400 -d30s http://3.17.69.68:8081/product/821 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
/** | |
* New Relic agent configuration. | |
* | |
* See lib/config/default.js in the agent distribution for a more complete | |
* description of configuration variables and their potential values. | |
*/ | |
exports.config = { | |
/** | |
* Array of application names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The original GET request which worked when the service ran on its own | |
getData(id){ | |
axios.get(`/data/${id}`) | |
.then( (response) => { | |
this.setState({ data : response.data }) }) | |
.catch( (error) => { console.log( `The error of the axios GET is: -------> `, error); }) | |
} | |
// Refactored GET request to take advantage of an example baseURL | |
getData(id){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
/** | |
* New Relic agent configuration. | |
* | |
* See lib/config/default.js in the agent distribution for a more complete | |
* description of configuration variables and their potential values. | |
*/ | |
exports.config = { | |
/** | |
* Array of application names. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE INDEX <index_name> ON <table_name> (<field(s)>) # Add an index | |
DROP INDEX index_name; # Drop an index | |
\d <table_name>; # See all indexes on a table | |
\di; # See all indexes in a database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//psql | |
sdc=# EXPLAIN ANALYZE SELECT * FROM descriptions WHERE product_id = 98242; | |
QUERY PLAN | |
------------------------------------------------------------------------------------------------------------------------------------ | |
Gather (cost=1000.00..671780.94 rows=1 width=461) (actual time=28182.350..28187.140 rows=1 loops=1) | |
Workers Planned: 2 | |
Workers Launched: 2 | |
-> Parallel Seq Scan on descriptions (cost=0.00..670780.84 rows=1 width=461) (actual time=19120.669..28177.305 rows=0 loops=3) | |
Filter: (product_id = 98242) | |
Rows Removed by Filter: 33334 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//mongo sh | |
db.collection.createIndex() | |
db.collection.getIndexes() | |
db.collection.dropIndexes(["<index_name>"]) |