عملکرد باطن را برای برنامه های وب محتوا محور بهینه کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای هر نوع مقیاس بندی، معماری برنامه خود و بهینه سازی هایی که ممکن است امکان پذیر باشد را در نظر بگیرید. به عنوان مثال، محتوای ثابت باید از شبکههای بهینهسازی ارائه محتوا که مزایای قیمت و عملکرد را ارائه میکنند، ارائه شود . حافظه پنهان اضافی برای پشتیبان ذخیره سازی داده نیز ممکن است عملکرد را بهبود بخشد و الزامات مقیاس بندی گران قیمت را به حداقل برساند.
معیارسنجی و آزمایش عملکرد میتواند گلوگاههای بالقوه عملکرد را در طول توسعه شناسایی کند، به ردیابی روندها در طول زمان کمک کند، و با مقایسه معماریها، پشتههای فناوری، ارائهدهندگان ابر یا گزینههای دیگر، از تصمیمگیری پشتیبانی کند.
تست بار از انواع بار، ترافیک یا داده های از پیش تعیین شده و کنترل شده برای اندازه گیری عملکرد backend شما در برابر اهداف شما استفاده می کند. می توانید ببینید که سطوح بارگذاری مختلف چگونه بر عملکرد برنامه شما تأثیر می گذارد.
تست مقیاس پذیری بر تجزیه و تحلیل توانایی برنامه شما برای افزایش مقیاس و مقیاس بندی تمرکز دارد. تست مقیاس پذیری نشان می دهد که برنامه شما چگونه به بارهای افزایش یافته پاسخ می دهد و چگونه پشتیبان (از جمله ذخیره سازی داده ها) سازگار می شود.
قبل از شروع محک زدن برنامه، اهداف واضحی را تعریف کنید، از جمله عملکرد و سرعت (به عنوان مثال تأخیر، توان عملیاتی، سرعت)، استفاده از منابع (استفاده از CPU، استفاده از حافظه، ترافیک شبکه بین اجزای پشتیبان) و هزینه. هرگونه تاخیر در مقیاس بندی را در نظر بگیرید. برای مثال، اگر برنامه نیاز به مقیاسی فراتر از یک مجموعه اختصاص داده شده از منابع "ذخیره" در هنگام رخ دادن انفجار یا جهش در ترافیک داشته باشد.
ابزارهای بسیاری مانند Apache JMeter و Locust برای بنچمارک و تست عملکرد در دسترس هستند. هنگام انتخاب یک ابزار تست، انواع تست های موجود را در نظر بگیرید، از جمله اینکه آیا به پشتیبانی برای اسکریپت نیاز دارید یا نه، یکپارچه سازی IDE برای اشکال زدایی، افزونه های اضافی، یا پشتیبانی از نوع ترافیک و مقیاسی که باید آزمایش شود.
اگر از ارائهدهنده ابری استفاده میکنید، مشخص کنید که آیا الزامات اضافی یا بهترین روشها برای هر آزمایش بار وجود دارد تا از محدودیتهای احتمالی جلوگیری شود. برای مثال، بهترین روشها را برای Cloud Run در نظر بگیرید.
در حالی که افزایش مقیاس برای بهبود عملکرد ضروری است، کاهش مقیاس نیز باید برای به حداقل رساندن هزینه مورد توجه قرار گیرد. هزینه پایه برنامه پشتیبان خود را بدون هیچ درخواستی و هزینه ای که برای افزایش مقیاس برنامه در نظر گرفته شده است را در نظر بگیرید.
ممکن است صرف نظر از کاربرد، هزینه های ثابتی برای معماری های داخلی یا مبتنی بر سرور داشته باشید. برخی از محیطهای ابری به شما اجازه میدهند تا زمانی که هیچ درخواستی ارائه نمیشود ، «مقیاس به صفر» را انجام دهید تا از هزینهها جلوگیری کنید. ارائهدهندگان ابر ماشینحسابهایی را به شما پیشنهاد میکنند تا پیکربندیهای مختلف و استراتژیهای قیمتگذاری، مانند تعهدات اولیه برای منابع را بررسی کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eOptimize application architecture and utilize content delivery networks for static content to enhance performance and minimize scaling needs.\u003c/p\u003e\n"],["\u003cp\u003eBenchmarking and performance testing, including load and scalability testing, are crucial for identifying bottlenecks, tracking performance trends, and making informed decisions about scaling approaches.\u003c/p\u003e\n"],["\u003cp\u003eEstablish clear performance targets, encompassing speed, resource utilization, and cost, and account for potential scaling delays when planning your infrastructure.\u003c/p\u003e\n"],["\u003cp\u003eManage costs by scaling down resources when they are not needed, leveraging cloud provider tools to explore pricing strategies and potentially scaling to zero to minimize expenses during periods of inactivity.\u003c/p\u003e\n"]]],["Application architecture should be optimized for scaling, such as using content delivery networks for static content and caching for data storage. Benchmarking and performance testing, including load and scalability tests, are crucial for identifying bottlenecks. Define targets for performance, resource utilization, and cost. Choose testing tools like Apache JMeter or Locust, considering test types and provider requirements. Balance scaling up for performance with scaling down to minimize costs, exploring cloud options like \"scale to zero.\"\n"],null,["# Optimize backend performance for content-driven web apps\n\nFor any type of scaling, consider the architecture of your application and what\noptimizations may be possible. For example, [static content should be served\nfrom optimized content delivery networks](/solutions/content-driven/hosting/cdn)\nthat offer price and performance benefits. Additional [caching for the data\nstorage\nbackend](/solutions/content-driven/data-storage/performance-optimization#cache)\nmay also improve performance and minimize the requirements for expensive\nscaling.\n\nPerformance testing and benchmarks\n----------------------------------\n\nBenchmarking and performance testing can identify potential performance\nbottlenecks during development, help track trends over time, and support\ndecision making by comparing architectures, technology stacks, cloud providers,\nor other options.\n\n**Load testing** uses predetermined, controlled types of load, traffic, or data\nto measure the performance of your backend against your targets. You can see how\nvarious load levels impact your application's performance.\n\n**Scalability testing** focuses on analyzing your application's ability to\n[scale up and scale out](/solutions/content-driven/backend/scaling). Scalability\ntesting shows how your application responds to increased loads and how the\nbackend (including data storage) adapts.\n\nDefine clear targets before beginning to benchmark the application, including\nperformance and speed (for example latency, throughput, speed), resource\nutilization (CPU utilization, memory usage, network traffic between backend\ncomponents), and cost. Consider any delays in scaling; for example, if the\napplication needs to scale beyond an allocated set of \"reserve\" resources when\nbursts or spikes in traffic occur.\n\nMany tools are available for benchmarking and performance testing, such as\n[Apache JMeter](https://jmeter.apache.org/) and\n[Locust](https://locust.io/). When selecting a testing tool,\nconsider the types of tests that are available, including whether or not you\nneed support for scripting, IDE integrations for debugging, additional plug-ins,\nor support for the kind of traffic and scale to be tested.\n\nIf using a cloud provider, determine if there are any additional requirements or\nbest practices for any load testing to avoid potential restrictions. For\nexample, consider the best practices for [Cloud\nRun](https://cloud.google.com/run/docs/about-load-testing).\n\nCost and performance considerations\n-----------------------------------\n\nWhile scaling up is essential to improve performance, scaling down should also\nbe a consideration to minimize cost. Consider the baseline cost of your backend\napplication without any requests and the cost involved in scaling up the\napplication.\n\nYou may have fixed costs for on-premise or server-based architectures,\nregardless of utilization. Some cloud environments allow you to *\"scale to\nzero\"* to avoid costs when no requests are made. Cloud providers offer\ncalculators for you to explore different configurations and pricing strategies,\nsuch as pre-commitments for resources."]]