Website crashing when too many requests happen at once - apache

We have a website which advertises a competition on TV each month. When the advert runs the website gets around 4000 submissions and this causes it to crash
The website runs off Silverstripe and is hosted on Apache.
I have read about queuing, and this sounds like the solution but I have spoken to the Silverstripe dev and the Server admin and both say that the other needs to make this happen.
My question is should the queuing be done on the website or the server?

To help Silverstripe handle lots of requests you can install the Static Publishing module:
http://www.silverstripe.org/introducing-the-static-publish-queue-module/
Your developer would implement that on the website.
This will create a flat version of your website that is served to users. This greatly reduces server load.

What kind of server are you running? You can get many different types these days... for example some do load balancing etc which might help prevent the crashing.
Also there are plenty of third party applications that you could integrate with to help you with job queuing like http://www.iron.io/ or http://aws.amazon.com/sqs/.
Another option is to find a module for silverstripe that already exists... I had a really quick look on github and found a one that might do the job you require -
https://github.com/silverstripe-australia/silverstripe-queuedjobs
Let me know how you get on :)

Good overview of all the areas to look at for SilverStripe on http://www.silverstripe.org/improving-silverstripe-performance/.

Related

SAM broadcaster web integration with spacial.com

I have SAM BROADCASTER PRO and I want to integrate it to my website for live streaming and showing playlist.It will be a great help if I get a solution over here.
I can't write much more as I don't have much experience with it.
And one more thing it is bought from spacial.com
If you look the folder into which you installed Sam Broadcaster. By default I think it goes to /program files(x86)/spacialaudio/ you will find two folders, SamHTMLweb and SamPHPweb. Both of these can be uploaded to a web server and with a little configuration provide you with a dedicated web site for Sam Broadcaster.
If your desire is to intergrate it with an existing website than you can find code in either of these folders that you can incorporate into your existing website.

How to address Firebase from an Arduino?

Background: I've a sensor hooked up to an arduino printing readings through the serial monitor. I want to log these in firebase.
I've done a bit of digging on this, and my research has shown me that an arduino simply can't handle the SSL needed to talk to firebase properly.
Any suggestions for workarounds? Checking SO and google's only turned up "it can't be done", but I figured I'd ask anyway. Any lateral thinking is appreciated, thanks!
If you figure out a way, let us (support#firebase.com) know. That would be an awesome hack!
Some thoughts:
You might want to look into the Spark Core (available for pre-order). They mention SSL support, though it's unclear to me what that means exactly.
You could proxy the requests through a server that can speak SSL. For instance, you could run a tiny node.js service on an Amazon EC2 box that just proxies REST requests to Firebase (e.g. using http-proxy).
If you're hardcore, you could try to get the Arduino talking to an external ethernet controller that has built-in SSL support (e.g. this one), but that's probably a big project. :-)
Longer-term, we might expose a non-SSL endpoint for Firebase requests that's specifically for this sort of low-end hardware use-case. Ping us at support#firebase.com if you want to start a dialog.
Here's a php script I whipped together to solve for Arduino no https.
It's basically a form that GETs to the php script and then sends it off to your Firebase database.
http->php->Firebase
https://github.com/robertcedwards/httpFirebase
*Make sure you add Heroku or your server to the whitelist of IPs that can post to Firebase
I know its an old question but visitors from google keep coming.
Have a look at this post: http://www.devacron.com/arduino-firebase/
[EDITED]
These arduino libraries might help:
firebase-arduino
https://github.com/googlesamples/firebase-arduino
https://github.com/ed7coyne/firebase-arduino
To install it:
Download the zip file, go to Sketch>Manage Libraries>add .zip file
Now you have access to
#include <FirebaseArduino.h>
and can begin using it with
Firebase.begin("example.firebaseio.com", "token_or_secret");
Follow the example at https://github.com/ed7coyne/firebase-arduino/blob/master/examples/FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino

How do I go about safely taking a screenshot of a website that I know is infected with malware?

Background:
One of my clients' websites has become a malware infested hotbed.
Disposing of the malware has proven difficult and time consuming, and, in the meantime, we still have had to do work on the site.
For now, we went to some trouble to do our work - creating a disposable VM to just run a web browser, so we can see what the site looks like for the designers' work, for example.
I'm wondering if there's an easier (and faster) way to get an idea what the design of the site looks like. Not everyone on the project is tech savvy enough to be trusted with, for example, properly handling switching VMs.
Question:
Is there a method for safely seeing what a malware infested website looks like (for example, a service which will browse the site for me and send a screenshot), one which ideally is easy and simple enough to use that I can trust our non-tech-savvy designers to user?
You might take at look at Internet Archive: Wayback Machine to see if the site has been archived.
If a screenshot is all you need, there are several online browser simulators, such as Net Renderer (which will run any inputted web URL in a given version of Internet Explorer and then supply a screenshot). You might also try BrowserStack, which requires an account, and is not free, but does have a free trial period, and offers more than Internet Exploder.
You could also try running a browser in Sandboxie, which is simpler to set up and use than a VM (you just install it, and then use the windows right-click menu to launch any program in a sandbox of your choosing). However, it isn't free for commercial use.
I don't know if exist a standalone tool to parse a website for malwares, but I think this can help you, it's a google tool that you can you with a request and they will send you a response.
Follow the link:
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=168328
Hope it helped.

Integration of Awstats into Ruby on Rails

I'm currently working on a RoR project, and stumbled upon a problem.
What I have:
A RoR 3.1 project running on Nginx on a debian server.
What I want:
I want to be able to see the web statistics of my website. Statistics like the amount of hits, the source and perfectly ordered per some predefined time interval. Preferably with a few cool graphs, charts tables, whatever.
What I did:
I looked on the internet for some RoR extensions which supported this, but didn't got very excited with the results. Therefore I looked at tools like 'Webalizer' and 'Awstats'. Finally decided to go with Awstats.
What seems to be the problem:
Now I can access the main page of Awstats, but once I want to look at other months, it sends a request to awstats.pl. This request is (I think) send from Nginx to RoR first. Then RoR looks in its routes.rb for the correct route. Then RoR can't find the route, and redirects me to the 404 error.
I would like to know if there is somebody out there who has some experience in these kind of things. Maybe knows how to configure Awstats correctly for RoR, or either knows another good statistics tool for RoR.
Any help will be greatly appreciated.
-Ron

What is the easiest way to install a R web application through RApache?

I use windows XP and R for my desktop use. And a shared hosting account (at some company) for my web hosting needs.
I wish to create an R web application and I understand that one such way is by using R with Apache through RApache , but since my current shared hosting plan doesn't allow me to install RApache I am a bit stuck.
So... (and here's my question) what would be the easiest/fastest/cost-effective way to get started?
Buying a more expensive hosting package ?
Hosting the thing myself? (on windows ?!)
switch to some other hosting company that permits the use of RApache?
Any suggestion will be most helpful.
Self-hosting is an option if you insist on using RApache. This might be easier than you think. Here's a link to a blog post i read a month ago before i decided to buy the hardware and server my own files. i just watched this seven minute YouTube video tutorial entitled "R Web Application–'Hello World' using RApache" I believe this was just posted today.
In seven minutes, the author walks through building a "hello world" Site using RApache then walks through a more ambitious example, building a user-input form to collect inputs then deliver them to a particular R function--pretty much a exemplary slice of what i suspect most people would want to use RApache for.
A second option is using a web framework. My recommendation here is Django. Why? It's written in Python so you can access R functionality via the python bindings (RPy2). Second, if you are not an experienced web developer, Django is in many ways, a great framework to begin with because it's truly a "full-stack" solution--it works more or less out of the box. In addition, there is a substantial and growing body of quality step-by-setp tutorials, code snippets, and even packaged django Sites, to learn from.
it seems they provide a VMWare image to get up and running quickly.
I suggest you download VMWare player and try the image. Since RApache isn't available for Windows, this is the most simple way, I guess. I wouldn't use that for hosting, but I would first try whether this stack is actually the right thing for your app. Also, this allows you testing things locally.
Doug,
Should I read your suggestion as saying that a Django app can call the RPy2 functionality without RApache? If so, that sounds like a solution for folks on shared hosting who can't install the RAPache module.