Things to do on a production server [closed] - django

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
We just launched our product recently. It's been great, I couldn't have done it without StackOverflow. You guys have been great. Thank You.
So yeah, getting to the question -
What are the fundamental things that I should take care of in a production environment?
The kind of answers I'm looking for would be for example - run a cron job to take regular backup of your database etc..

Well besides a cronjob for backing up the database (make sure you save the old backup to avoid corruption) theres the user upload directory..
I suppose you can create an image of the upload path and files at any given interval that suits your site's activity.
Also I'd always make sure logfiles are maxed in size limit so you don't end up with 10 miles of text logs crammed in one file..
Security stuff tends to be overwhelming, however basically make sure the directories are chmod/chown properly. Probably want to avoid unwanted ssh access, so either use the iptables to make sure it's hard to get in, or atleast update your password from time to time..
I think this topic could go on for ages :-)

if your are using apache server then
this article ( http://www.devshed.com/c/a/Apache/Server-Limits-for-Apache-Security/ ) will be very usefull to you.
plus
Compress your graphics and use Django compressor application to reduce significant js/css
load ..
http://coderpriyu.blogspot.com/2011/12/django-compressing-cssjs-files-with.html

Related

advice for naming GCP projects [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am building a mobile dating app and plan to leverage google's cloud infrastructure.
I'm trying to figure out whether the entire application should live in a single GCP project or not.
On reading the best practices documentation I can see they advise the following naming convention:
[company tag]-[group tag]-[system name]-[environment (dev, test, uat, stage, prod)]
So should I split all the core components of the application between different projects? For example one for the data science matching algorithm (fizz-ds-matching-dev) and one for the android application? Or should I jam it all in one project?
Looking to follow best practices...
You're asking for some heat here. What to call things is probably as confrontational as asking vim or emacs!
As an employee of a large company where I oversee like 50 GCP projects my advice would be pick a naming scheme that lets your i-dont-have-time-for-this-kubernetes-gke-yaml-shit developer/pm/boss man find the project they want in 8 key presses or less.
A scheme which has worked well for me is: org-app-environment which is fairly close to what google recommends. I imagine your ops, so dont try to be clever with your naming scheme. Even though your users are dev, they're still users. If it takes them more than 5 seconds to find their project, they will do whatever the equivalent of an Arab spring is in the software world.
You need to find the nirvana of if the new guy is using this, is it easy to filter and find and is it quick to identify wtf is running there.
I recommend org-app-environment. Drop the org if you only have one, otherwise keep it.
Gods speed ops man.

Why should I use ember js [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I just became familiar with ember js and came to know that I have to build ember app and deploy the dist folder to my server. As I join new job and they were already using ember so I have to use it but I figured out some thing very bad. I wanted to share and ask for clarification.
It creates one large js file which was near 2MB and will increase as modules usage and features will increase.
As it is compiled to one file I cannot figure out which feature was broken and I have to look at it in the latest release or some thing like that.
While developing when I run the ember server it kills me when it is taking time.
Please let me know if you know some good points about ember also the bad points.
Before this question gets closed, let me slip in some thoughts:
It creates one large js file which was near 2MB and will increase as modules usage and features will increase.
Yes, it does. Basically, Ember is large. People have been exploring approaches to this for years, but AFAIK there is no silver bullet at the moment.
As it is compiled to one file I cannot figure out which feature was broken and I have to look at it in the latest release or some thing like that.
I don't understand this part of your question. Perhaps you could provide details on a specific case.
While developing when I run the ember server it kills me when it is taking time.
It's most likely the build process, not the server, which is slow. There are some approaches to solving this, including running the Windows console in administrator mode, which you can find by googling for "ember build slow". Here's a possibly out-of-date SO question on the topic. The simplest approach is to get a faster machine with SSD, and/or work on Mac/Linux.
Please let me know if you know some good points about ember also the bad points.
Many people love Ember. Many people hate it. Many people have a love-hate relationship with it. It appears that the current Ember adoption rate is in the low-to-mid single digits. Draw your own conclusions.

Can anybody recommend an app in google drive for editing c++ files? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I store my school programming work on google drive. From home I just access the google drive file on my computer, but I can't do that from school.
Can anybody recommend an app for editing cpp files in google drive? Preferably free, poor college student and all that.
I found drivecode, but it doesn't seem to work with cpp files and on header files it's not doing any markup.
Neutron Drive seems like exactly what I need, but it's not free.
Alternatively, any suggestions on another cloud-based development platform that I could use would work too.
screw Google driver, for single files use
https://gist.github.com/
http://collabedit.com/
for large project as said above, start learning mercurial. later you will need it professionally.
In light of the comments under the question, I think the best option is actually to use a service like gitHub, mercurial, bazaar, or svn, because of the availability of version control in those platforms.
You might also want to try out Google Code, it's not quite as advanced as GIT and hopefully it's not blocked either. Also, you already have a Google account, so you won't have to make a new account for anything.
Google Code allows full editing capabilities online, but you can also create a repository using it and download your code when you're ready to compile. You may need to learn a little bit about it before you can start, but once you upload your code you can edit it all right there, and it also formats automatically, making it better than Drive.
If Google Code is in fact blocked, I would also suggest trying GIT or some other service, but they're a little more advanced. Google Code has served me well for simple projects in the past.
Go to http://code.google.com

How to measure and solve the bottleneck in a website with 60K PV/day [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'll try to start with the real life example in my case:
I have a website with around 60K page views per day (at peak time, 100 active visitors on site, due to google realtime analytics). Django+mysql+apache. 1 Linode server with 1024M RAM and 4core CPU, and amazon S3 service to store static files. It turns out to me now it reaches its bottleneck (peak time it response slow).
One thing I could see is from the memory, nearly 91% of memory being consumed at peak time. But not sure if there are some other bottlenecks.
2 questions:
1: Where: If I want to solve this problem, I need to know exactly where the problem sits in. So I'm wondering how could I measure where the bottleneck is?
2: How: How could I solve the memory bottleneck? One way I could think of is to simply add more memories, or add more machines using the load balancers (sure it's more expensive...). Another way, not sure, but possibly change from apache to nginx?
EDIT:
You could also see the memory usage generated from the top command here, 30 apache instances with each consuming 2 percent (20M) of the memory.
http://codepad.org/pUYdZhWq
Without knowing a lot more about how your site behaves it's hard to make recommendations. And the list of questions that would need to be answered is huge. Put simply, if you were to pay a competent person to investigate the issue it would cost you an awful lot more than putting another gig of memory in the server.
OTOH, if I were the person being paid to resolve the problem, one of the first things I'd be looking at is the speed of the server - turning requests around faster means fewer requests resident in memory, means less memory used by the webserver (and more for cache/buffers). So start measuring your response times (%D) and analysing the data. Make sure you're using an opcode cache, and enable output compression for your PHP (ob_gzhandler()) and enable compression for CSS javascript and html files on the webserver. Make sure you've stripped all unused modules from Apache and are using a sensible value for the keepalive timeout (2 seconds or less).
If you're running any COMET stuff then, yes you should definitely switch to nginx, otherwise the benefits are limited.

How can I be quickly notified of a specific change to a web page? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
My girlfriend is signing up for college courses, and she missed out on registration for a particular class that's ideal for the upcoming semester. All sections of the class are full. However, other students may drop/withdraw at any point, opening up a seat that she'd want to register for immediately.
I'm not aware of any auto-notification tool on the college's website. So, rather than reloading this page manually all day long over the next several weeks, I'd like to set something up to auto-notify her if a seat opens up.
What are the best/easiest options to do this?
This is the web page that I would need to monitor:
http://www6.austincc.edu/schedule/index.php?op=browse&opclass=ViewSched&term=212S000&disciplineid=PCVCD&yr=2012&ct=CC
Here is a screenshot of the specific numbers that I'm interested in:
https://skitch.com/troywarr/gptbe/acc-course-schedule-course-schedule-by-discipline-spring-2012
For any of the five course sections, when the first number (shown in the orange box) drops below 12, I'd like to know as soon as possible.
I envision this being some sort of web scraper that operates on short intervals (like every 5 minutes), checking for changes to the text within the appropriate HTML elements, then interfacing with an SMS system (ideally) or email.
This is important enough to warrant setting up a tool like this, but I don't have more than about a day to devote to it, so I'm hoping that such a tool or service already exists, and would greatly appreciate any recommendations. If not, any suggestions on what tools/languages/technologies to use would be great. Thanks!
It's already been done for you.
http://www.austincc.edu/register/waitlists/
Register for the waitlist and she'll get an email when a spot opens up.
It' standard fare at pretty much any educational institute. ;)