-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c0047d
commit 342fdbe
Showing
3 changed files
with
146 additions
and
52 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pystackql import StackQL\n", | ||
"stackql = StackQL(download_dir='/srv/stackql', execution_concurrency_limit=-1, app_root='/jupyter/.stackql', output='pandas')\n", | ||
"stackql.executeStmt(\"REGISTRY PULL aws\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"regions = [\n", | ||
"'us-east-1',\n", | ||
"'us-east-2',\n", | ||
"'us-west-1',\n", | ||
"'us-west-2',\n", | ||
"'ap-south-1',\n", | ||
"'ap-northeast-3',\n", | ||
"'ap-northeast-2',\n", | ||
"'ap-southeast-1',\n", | ||
"'ap-southeast-2',\n", | ||
"'ap-northeast-1',\n", | ||
"'ca-central-1',\n", | ||
"'eu-central-1',\n", | ||
"'eu-west-1',\n", | ||
"'eu-west-2',\n", | ||
"'eu-west-3',\n", | ||
"'eu-north-1',\n", | ||
"'sa-east-1'\n", | ||
"]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# threading test 1 - stackql native golang threading\n", | ||
"\n", | ||
"regions_list = \"','\".join(regions)\n", | ||
"stackql_query = f\"\"\"\n", | ||
"SELECT region, function_name\n", | ||
"FROM aws.lambda.functions\n", | ||
"WHERE region IN ('{regions_list}')\n", | ||
"\"\"\"\n", | ||
"\n", | ||
"import time\n", | ||
"\n", | ||
"start_time = time.time()\n", | ||
"result = stackql.execute(stackql_query)\n", | ||
"end_time = time.time()\n", | ||
"\n", | ||
"print(f\"Time taken (Go threading): {end_time - start_time} seconds\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# threading test 2 - python threading model\n", | ||
"\n", | ||
"queries = [f\"SELECT region, function_name FROM aws.lambda.functions WHERE region = '{region}'\" for region in regions]\n", | ||
"\n", | ||
"import nest_asyncio\n", | ||
"nest_asyncio.apply()\n", | ||
"\n", | ||
"start_time = time.time()\n", | ||
"result = await stackql.executeQueriesAsync(queries)\n", | ||
"end_time = time.time()\n", | ||
"print(f\"Time taken (Python async): {end_time - start_time} seconds\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
/srv/stackql/stackql --version | ||
echo "starting stackql server..." | ||
nohup /srv/stackql/stackql --http.response.pageLimit=-1 --pgsrv.port=5466 srv & | ||
nohup /srv/stackql/stackql --execution.concurrency.limit=-1 --http.response.pageLimit=-1 --pgsrv.port=5466 srv & | ||
echo "stackql server started" | ||
start-notebook.sh --NotebookApp.token='' |