我正在开发我的第一个webapp项目,该项目计划使用远程服务器发布。我对架构有疑问。
My webapp is to scrape tweets using twitterscraper
Python package. A user who visits the website enters some keywords and click "Scrape" button. A Python backend scrapes the tweets containing the keywords, goes through some Natural Language Processing analysis, and visualise the result in charts. This twitterscraper
package lets you scrape tweets using Beautiful Soup
, therefore you don't need to create an API credential. The scraping speed depends on the bandwidth of the internet that you are using.
我制作了Python脚本,JavaScript文件,html文件和css文件。在我的本地环境中,webapp完美运行。
所以问题是,在我将这些文件放到托管服务器上并发布了Webapp之后,当用户单击“抓取”按钮时,抓取速度取决于什么?用户正在使用的互联网带宽?还是服务器依赖任何“带宽”?
正如我说的那样,我对这种架构非常陌生。因此,很高兴向我建议构建这种webapp的另一种方法。谢谢!
瓶颈在哪里取决于一系列不同的变量。
如果您要进行大量数据操作,但没有为该程序分配大量CPU时间(即,处理器要处理的用户太多),则可能会降低速度。
如果您没有足够的内存,并且您试图解析并返回大量数据,则可能会降低速度。
由于您也在与Twitter交谈,因此服务器与Twitter服务器之间的带宽限制将影响您从其API检索结果的速度,并因此影响程序响应用户所花费的时间。
您和用户之间也存在联系。如果那很慢,可能会影响您的程序。