How to find the course of multiple php-cgi process? - php

I have a small wordpress blog on local zend server. Recently I felt my PC slow down and I found a lot of php-cgi.exe are running. Some said cron job is the course but I don't have any plugin running cron job. Where can I go to check the log of php-cig process?

Related

Does drush commands cause outage?

With our CD process, we have configured the following drush commands to be executed after code sync on the servers -
drush #hostname rr
drush #hostname cc all
drush #hostname fra -y
drush #hostname updb -y
Now I want to know if execution of the above commands cause an outage.
Thanks
This depends largely on what code you push exactly. The more custom the code, the more likely something may break at all. I've seen a lot of sites running similar commands as part of their deployment routine without a problem. Most likely it's drush cc all that may abort due to memory limit exhaustion. But this won't break your site.
To ensure your commands will run successfully in your live environment I'd recommend to implement some sort of continuous integration. For example CircleCI (1.500 build minutes free per month) or TravisCI (free for open source projects). Here is an example: https://github.com/leymannx/drupal-circleci-behat. Though it's for Drupal 8 I guess you'll get the idea.
By that you'll basically set up your site from scratch inside some temporary and configurable server (Docker), import a dummy database, run your commands, maybe run some testing (Behat) and then ONLY when everything went fine the site will be deployed to the live server where your deployment commands run again.
Depending on how often those command run and how big the site is, those commands can put a strain on the server and cause outage. If this is only on deployment then still can cause outage depending on the range of factors, but that can be more controlled such us have the deployment at the time when there isn't much traffic.
Check out a list of drush commands at drupalreference.com

ATK4 & cron job, using of ds-addons/Scheduler

I need cron job for my new application and found a nice add-on by DarkSide, but im having some difficulties using it.
The add-on is here: https://github.com/romaninsh/TemaOrig/tree/master/ds-addons/Scheduler
I have installed it till step 3, where windows scheduler reports "The windows cannot find the file specified".. but i guess i will try this tommorow.
What im really interested is some example of configuration (step4)
4a) Set scheduler global settings in "Config" tab.: How should i insert them, directly into database? So how do i insert: Important is, that you set "Heartbeat time" to exactly the same value (in minutes) what scheduled in your cron tab or Windows task scheduler.
Just a guess:
name: Heartbeat time
value: 5? Like every 5 minutes? Or do i put cron expression?
description: ??
4b) Create Tasks.
I really do not know how to use this. What do i insert for Code, Class, Action?
Actually original source of ds-addons is here: https://github.com/DarkSide666/ds-addons and I'm author of this addons pack and particular add-on - Scheduler :)
Questions and tips for you:
What is folder structure in your project folder? I'm of course especially interested where ds-addons folder is located.
Which version of Windows are you using and do you have Administrator rights on that machine?
Can you find file wscript.exe in your system hard-drive / Windows installation folder? In my WinXP it's located in c:\windows\system32 folder and as result is in PATH environmental variable and is accessible from anywhere. If that's not your case, then you have to provide full path to wscript.exe
4a is no more needed in latest version of add-on
There is a sample Task class in readme in latest version of add-on
In Windows scheduler you can set script to execute every minute or every 3-5 minutes not less. Otherwise you'll have big delays between scheduled time (in add-on) and actual execution time.
Solution:
Download latest add-on version from https://github.com/DarkSide666/ds-addons and check out changes in it's readme file.

Continuous Deployment with Jenkins & PHP

I'm sure there are answers for this all over stackoverflow but I was unable to find anything specific.
I have a PHP project which I am revisiting. Its running on a RHEL5 box. I have SVN on the same box.
Out of curiosity I recently added Jenkins to the machine and have the jenkins php template at...
http://jenkins-php.org/
There was a bit of playing around with the setup but I more or less have this all running and doing Continuous Inspection builds when something is committed to SVN.
What I want to do now is have Jenkins copy my updated files across to the server when the build completes.
I am running a simple LAMP setup and would ideally only like to copy across the files that have actually changed.
Should I just use ANT & sync? Currently the files reside on the same box as the server but this may change whereby I will need to sync these files across to multiple remote boxes.
Thanks
Check these - Copy Artifact Plugin and the job's env variables.
Now set 2 jobs - 1 on source machine and 1 on destination server (make it a slave). Use the plugin to copy required artifacts by using environment variables.
Do you have your project (not the jenkins but that with LAMP setup) under the SVN? If yes I'd recommend to create standalone job in Jenkins that will just do an svn up and you could tie it to jenkins job the way like - you running your main job, and if build is ok jenkins automatically runs job to update your project.
For copying to other servers take a look at Publish Over plugins
It's very easy to setup server and rules. The bad thing is that you can't setup copying only the new files for current build which means that the entire project is uploaded every build.
If your project is too big, another solution is to use rsync as post build action.

Running gearman on a Heroku Worker

I have a PHP app running on heroku (cedar stack). I'm at the point where I need to start passing jobs off to workers.
I've looked a both RabbitMQ and gearman. It seems like the best / simplest solution for my app would to use gearman.
So I'm guessing the gearman server would run on the main webapp dyno and then the gearman workerapi would run on separate heroku workers, along with the php code that should do the work.
How can I go about doing this with Heroku?
Thanks
Queuing is best done with an addon https://addons.heroku.com/#queues. The link ( devcenter.heroku.com/articles/background-jobs-queueing ) in the comment to your question by ficuscr should provide you with some insight as to how exactly to implement your workers.

Using Apache ANT to deploy web applications?

I was just able to get Apache ANT running on my computer. The ant -version commando outputs the version number , verifying that the installation went well.
I have read that ANT is well suited to handle deployment of web applications including PHP projects and have spent some time to get it working, but I just can't get my head around how to set it up to sync my files to my web server.
How can I make ANT sync folderA with folderB ?
Thanks
Last time I checked (long ago) there was no remote sync task in Ant (only local). You would have to write a shell script that calls rsync and execute this from Ant instead. There is a number of remote tasks though. And you could check out your code from your VCS instead of syncing it to the server.
On a sidenote, you might want to consider Phing over Ant. It's a port of Ant to PHP. It has a FileSync Task. You can also add your own Tasks (written in PHP) and is commonly used in Continuous Integration servers for PHP.
Also see What is your preferred Deployment Strategy for PHP and a couple others.
Read the manual: http://ant.apache.org/manual/index.html
Look at the <copy> task.
I was looking to do the same and just came across this article on how to deploy using ant, maybe it'll give you a different way of going about it: Deploying using Ant

Categories