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

  • Home
  • SEARCH
  • 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 8129247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:14:30+00:00 2026-06-06T08:14:30+00:00

Here’s the scenario I anticipate: I have an app written in PHP which has

  • 0

Here’s the scenario I anticipate: I have an app written in PHP which has a domain layer (complete with validators, etc). I want to use node.js for my web services for performance in high concurrency situations. If I create a command line interface for my php domain layer (see below), will this give me better performance than just using Apache? Is this even a good way to do this? I’m new to node.js and am trying to get my bearings. Node: The command line interface for the domain layer will return json encoded objects.

//Super simple example:
var http = require("http");
var exec = require('child_process').exec;

function onRequest(request, response) {
  exec("php domain-cli.php -model Users -method getById -id 32", function(error, stdout, stderr){
      response.writeHead(200, {"Content-Type": "application/json"});
      response.write(stdout);
      response.end();
  });

}

http.createServer(onRequest).listen(80);
  • 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-06T08:14:33+00:00Added an answer on June 6, 2026 at 8:14 am

    will this give me better performance than just using Apache?

    You would have to measure it to be sure, but I highly doubt it.

    Node’s performance benefits come because it is a select()-based server, so it eschews threading and blocking (with expensive context switches and CPU pipeline stalls) in favor of non-blocking IO (aka green threading). If you offload all the work to PHP, then you’re basically just using Node as a front-end server — at which point you should just use Apache, since mod_php will be doing almost exactly what you’re doing. Only mod_php can do it better, because it can keep the PHP interpreter hot in memory, instead of having to spin up a new interpreter on every request like you’re doing.

    Is this even a good way to do this?

    Essentially what you’ve done is reimplement CGI using Node. So I would say no — if CGI is what you want, there are plenty of existing implementations out there!

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

Sidebar

Related Questions

Here are the tables I have: Table A which has entries with item and
Here is the scenario: I have several CIFS partitions which AD-based users can mount
Here is the two scripts I have Script 1: <? include('config.php'); $json = $_POST['payload'];
Here is a scenario: User installs .NET application that you have made. After some
Here is my situation: I am making a countdown app which works fine but
Here are some facts about my app followed by a question My app has
Here is my scenario. I have a website running under AppPool1 and that works
Here the scenario is I have many .aspx pages if any page gives error,
Here's the scenario: I have a local git repository that mirrors the contents of
Here is what I am trying to achieve in PHP: I have this string:

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.