There is no 1 article to explain but you can research each part.
1. One Postgresql connection is a forked process and has memory overhead (4MB iirc) + context switching.
2. A connection can only execute 1 concurrent query (no multiplexing).
3. Asyncpg to be fast, uses the features that I mentioned in my parent post. Those can only be used in Session Pooling https://www.pgbouncer.org/features.html.
The whole point of async is to some other work while waiting for a query (ex a different query).
If you have 10 servers with 16 cores, each vcore has 1 python process, each python process doing 10 simultaneous queries. 10 * 16 * 10 = 1600 opened connections.
The best way IMHO: Is to use autocommit connections. This way your transactions execute in 1 RPC. You can keep multiple connections opened with very light CPU and pooling is best.
I've done 20K short lived queries/second from 1 process with only ~20 connections opened in Postgresql (using Pgbouncer statement pooling).
Unless I'm misunderstanding, this isn't what I'm looking for. I'm looking for expandable storage - the ability to add GB/TB by adding disks. Replication is important, yes, but if I can't grow the volume, I'll just plain cry.
"Many consumers have enjoyed the falling price of fuel in the form of lower petrol prices; several UK supermarkets have begun selling petrol at below £1 per litre - which they last did in 2009."
It feels as though prices haven't fallen relatively here in Canada, at least not on the west coast.
1.00 CAD in the east, gasoline should be around 0.80 now but because of weak loonie, oil refineries being in the US and Americans driving more, thus increasing the demand for gas, prices are what they are.
I can only assume that you are not using any mainstream *nix-based operating system. Installing through package management is easy for both MySQL and PostgreSQL.
I am using elementary OS and I have installed it many times, can you give me a good tutorial about installing and configuring postgres? I want to use it with golang for development of webapps. I am not trolling here btw, I am really stuck with sqlite because of inability of installing postgrest :(
I mean, with Gentoo Linux I had to do the following things:
* If I wanted to make Postgres listen on non-localhost, modify listen_addresses in postgresql.conf.
* Add database access controls as required in pg_hba.conf. The comments in the file are illuminating, but one can examine [0] for more information. [1]
* Create a database with appropriate permissions, along with a user. [2]
* Start Postgres.
I remember having to do the equivalent of all of those things every time I had to install MySQL. :)
What -exactly- did you successfully do, what -exactly- did you fail to do? Divulging that information will help guide assistance efforts. :)
I use elementary OS and all I did was sudo apt-get install postgres
I have no idea what it installed and what it didn't, in the entire process never once it asked me for a password and while connecting to the database it says that invalid password and I can't reset password without connecting to the database!!
May I know your email ID? so I'll try to install it once and tell you how it goes.
As of now I have everything installed plus the graphical client with the elephant logo, but I just have no idea what the password is
> ...the entire process never once it asked me for a password and while connecting to the database it says that invalid password and I can't reset password without connecting to the database!!
Well, because you have access to the file that causes Postgres to determine whether or not you need to provide a password to access a given database (pg_hba.conf), you could simply change the authentication method to one that doesn't ask for a password. :)
However. On every Postgres install I've ever used, there are the following lines in pg_hba.conf:
# "local" is for Unix domain socket connections only
local all all trust
If we look carefully, we see that the Type, Database, User, and Method entries are present, but the Address entry is not. The comment also talks about a Unix domain socket connection.
Reading the "Connecting to a Database" section of the manual for psql [0] (the official command-line Postgres client) tells us that if we omit the hostname, psql attempts to connect over the Unix domain socket. So, try the following things:
* psql
When that fails, because 'role "$MY_USERNAME" does not exist', try
* psql -U $DATABASE_USER
(The Postgresql database user is typically postgres.) If that fails for some other reason, try
* sudo su - $DATABASE_USER
* psql
You should now be connected to Postgres.
If we enter help , we see that we can enter "\?" for help with psql commands. If we enter \? and look through the list of commands, we should see one that does exactly the thing that we're trying to accomplish.
Anyway, leave a message here to let me know how this all went, or to ask any follow up questions.
Hey man, thank you very much, I was somehow able to connect to the psql database :) i created a user, a database and successfully created and dropped a table!
HN these days is full of elitist people who think the people who are struggling with things are downright dumb, hence the multiple downvotes I got on the earlier comment. It is because of people like you, my friend, that HN is still a user friendly community :)
> ...I was somehow able to connect to the psql database...
Yeah? For posterity, mind detailing how did you do it?
> HN these days is full of elitist people who think the people who are struggling with things are downright dumb...
No. That's not what happened. You said:
> I have never been able to actually download install and use [Postgresql] ... unfortunately it isn't as simple as installing mysql[.]
Everyone who has installed both MySql and and Postgres know that you need to do exactly the same things [0] -albeit in slightly different ways to get started from scratch. Initial configuration of MySql and Postgres is equally complicated. [1] This makes your comment look like an anti-Postgres slam.
Cynical people might suspect that your original comment was the time-tested "Man, thing X sucks, can't do Y, and is completely useless!" Internet tech-support bait, but that ain't me, baby.
Over the years, I've found great profit in assuming that most widely-used non-B2B software [2] is actually generally well designed and thought-out, and that any inability to do a thing is a result of my lack of understanding or familiarity rather than poor or difficult design of the software. Why? Because, -frankly- such failures are pretty much always a result of my lack of understanding.
[0] Configure listen IP, create a superuser account, set database access permissions, create a database, start the daemon.
[1] That is, (compared to writing software that uses SQL) not complicated at all, and just as complicated as configuring any other non-trivial daemon.
Hmm I guess so everyone thought that I was the troll who just hates X because Y reason!!
I did a
sudo -u suraj createdb mydb
It said that role suraj didn't exist, then I realized that postgres was using my own username, I didn't touch a single config file! In a remarkable sense of irony, postgres is so amazing that while installation mysql needs us to give a password, postgres uses this user concept and for each database you have to create a new user so there is no one password to rule them all.
$ sudo -u suraj psql
I was just trying to do
$ psql
then it was saying that the role suraj didn't exist
so I did sudo -u postgres createuser --superuser $USER
then it said that role suraj exists, then it said database suraj didn't exist
> ...postgres is so amazing that while installation mysql needs us to give a password...
If you install Mysql from scratch, you also need to manually set the superuser password.
For a different perspective, read the relevant post-installation configuration documentation for Mysql [0] and Postgresql [1] on Gentoo Linux.
If your distro asks you -as part of the installation process- for a MySQL password, that's a feature that has been added by the MySQL packager for your distro, not a feature of MySQL.
> postgres uses this user concept and for each database you have to create a new user so there is no one password to rule them all.
This is completely incorrect. Look at pg_hba.conf and the comments contained within, as well as the GRANT command I mentioned in an earlier comment.
A suggestion:
Slow down. Block out an hour or two to learn how to properly manage both a Postgres and a MySql server.
Figure out that Postgres calls "Users" "Roles" (because a Role can be one or more users). Read about Database Role management in the official Postgres documentation. Learn about Roles and Role permission management. Do the same for MySQL.
Once you've done this you will
* Be able to manage DB user accounts and permissions without depending on random internet walkthroughs.
* Understand that -despite the terminology differences- managing users and DB permissions is fundamentally the same in MySQL and Postgres.
FWIW, I've found the Postgres documentation to be a little less easy for a novice to wrap their head around, but substantially higher quality than the MySQL documentation. Just remember that the Postgres documentation has sections that are purely reference material and sections that are mostly tutorials.
When in doubt, play around and make notes on what you did so when you accidentally burn it all down you can remember to not do the same thing twice. ;)
Partner with indirectly related products, services, websites, bloggers in your space. Reach out with a carrot to many of them - and there are _many_ - some of them will likely want to work with you.
You'll likely need to offer something tantalizing in return...
Surprisingly, I get this fairly often on my mobile. I'm not quite sure what's changed with the last version (or couple) of Android to trigger this. Over-secure, perhaps?
Android mobile browser requires the full signature chain of authorities who signed the site certificate[0]. It is done to avoid calls to CA servers and reduce network use on mobile devices.
If a person does not concatenate authorities signatures to their site certificate, Firefox and mobile Chrome will alert, desktop Chrome and Safari won't.