Fixed modal issue
This commit is contained in:
@@ -322,15 +322,14 @@
|
||||
"\n",
|
||||
"## A way to improve the speed of the Modal pricer service\n",
|
||||
"\n",
|
||||
"A student mentioned to me that he was concerned by how slow Modal seems to be. The reason is that Modal puts our service to sleep if we don't use it, and then it takes 2.5 minutes to spin back up.\n",
|
||||
"The first time you run this modal class, it might take as much as 10 minutes to build. \n",
|
||||
"Subsequently it should be much faster.. 30 seconds if it needs to wake up, otherwise 2 seconds. \n",
|
||||
"If you want it to always be 2 seconds, you can keep the container from going to sleep by editing this constant in pricer_service2.py:\n",
|
||||
"\n",
|
||||
"I've added a utility called `keep_warm.py` that will keep our Modal warm by pinging it every 30 seconds.\n",
|
||||
"`MIN_CONTAINERS = 0`\n",
|
||||
"\n",
|
||||
"To use the utliity, bring up a new Terminal (Mac) or Anaconda prompt (Windows), ensure the environment is activated with `conda activate llms`\n",
|
||||
"\n",
|
||||
"Then run: `python keep_warm.py` from within the week8 drectory.\n",
|
||||
"\n",
|
||||
"Remember to press ctrl+C or exit the window when you no longer need Modal running.\n"
|
||||
"Make it 1 to keep a container alive. \n",
|
||||
"But please note: this will eat up credits! Only do this if you are comfortable to have a process running continually.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user