Hi,
I want to know how to find the site visitors maximum allowed ,

for example i want to develop a site ,but i don't know how many users can acess the site maximum.

Is it possible to know and improve this visiting users capacity through PHP code.

I think google,Yahoo,amazon sites millions of users are browsing ,But the sites are not crashed.

How we can maintain the site like that

what are the development causes involved to develop and maintain site like that.

Regards
Bala

Dani AI

Generated

— there is no single “maximum visitors” number you can get from PHP alone. Capacity is a function of request rate, average response time, server resources, and where the work happens (app, database, disk, network). pointed to the general areas; below are practical steps to measure and plan capacity so limits can be found and raised predictably.

Start by measuring a baseline with controlled load tests and system metrics. Run a steady increase in requests until response time or error rate becomes unacceptable, while watching CPU, memory, disk I/O, and DB stats. Lightweight tools: k6 for scripted scenarios or ab (ApacheBench) for quick RPS checks (ab docs). Example k6 script:

import http from 'k6/http';
import { sleep } from 'k6';
export let options = { vus: 50, duration: '30s' };
export default function () { http.get('https://example.com/'); sleep(1); }

Use the measured RPS and average latency to estimate concurrent requests: concurrency ≈ RPS * latency_seconds. Monitor which resource hits its ceiling first (CPU, RAM, DB connections, network). Profile the app to find hotspots with Xdebug or an APM; fixing hot code paths gives the best return per effort.

Tune PHP-FPM to match available memory. A common calculation for pm.max_children is:

max_children = floor( available_RAM_for_php_MB / average_RSS_per_child_MB )

Reserve RAM for OS and the database when computing available_RAM_for_php. Also avoid session-induced request serialization by calling session_write_close() as soon as session writes are done, or move sessions to a central store like Redis.

When the single-server limit is reached, scale horizontally: make app servers stateless, add a load balancer, put long jobs into background workers, and use read replicas or sharding for the database. Follow the loop: measure → profile → fix → retest → scale.

Recommended Answers

All 4 Replies

1) Write efficient code.

2) Take advantage of caching.

3) Get high powered servers.

1) Write efficient code.

2) Take advantage of caching.

3) Get high powered servers.

As a developer ,What are the things i have to consider for efficent code,

OR

How to i identify the code is efficent one.

That's complex to answer. In most programming languages there are multiple way s to accomplish the same goal. But they aren't equal in terms of how much work they take the server to do. A common way to improve performance in a web application is to optimize your data queries. There are a variety of ways to optimize code and good programming book will cover it for its language.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.