Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:58:03+00:00 2026-06-13T05:58:03+00:00

I am trying to create a simple load balance script and I was wondering

  • 0

I am trying to create a simple load balance script and I was wondering if it is possible to find the response time of a server live?
By that I mean is it possible to measure how long it takes for a server to respond after the request has been sent out?

What I am trying to do is fairly simple, I want to send a request to a link/server and do a count down, if the server took more than 5 seconds to reply, I would like to fall on the backup server.

Note that it doesnt have to be in pure php, I wouldnt mind using other languages such as javascript, C/C++, asp, but I prefer to do it in PHP. if it is possible to do the task, could you just point me to the right direction so I can read up on it.

Clarification

What I want to do is not to download a file and see how long it took, my servers have high load and it takes a while for them to respond when you click on a file to download, what I want to do is to measure the time it takes the server to respond (in this situation, its the time it takes the server to respond and allow the user to download the file), and if it takes longer than x seconds, it should fall back on a backup server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:58:04+00:00Added an answer on June 13, 2026 at 5:58 am

    I think you should look at curl_getinfo it returns the following which is more than you need

    url
    content_type
    http_code
    header_size
    request_size
    filetime
    ssl_verify_result
    redirect_count
    total_time  <------------------ what you need
    namelookup_time
    connect_time
    pretransfer_time
    size_upload
    size_download
    speed_download <------- Speed 
    speed_upload
    download_content_length
    upload_content_length
    starttransfer_time
    redirect_time  <------ Can cause increase in time 
    certinfo
    

    Your Edit : if it takes longer than x seconds, it should fall back on a

    Solution: All you need is set CURLOPT_CONNECTTIMEOUT to x seconds … It would terminate and you can move on to other task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a simple ajax load test script that dynamically creates divs,
I'm trying to create simple script that subscribes a user to a company calendar.
I am trying to create a simple about page that uses JQuery click to
I'm trying to create a simple web page that resembles the following: I've got
Trying to create a simple custom control in C# Winforms that inherits from Panel,
I'm trying to create a simple youtube player that should show thumbnail of videos
I'm trying to create a simple application that is only supposed to be called
I create a simple form in Qt designer and am trying to load it
I'm trying to create a simple Imgur app that will upload images to their
i'm trying to create a simple Opencv program in C that creates a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.