[DNG] starting mysql in background ?

2022-06-15 Thread Radisson via Dng

Hello list,
i would like to start my mysqld 8.0 in background because it takes
several minutes to start.

Does someone have a solution ?

re,
 pr
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] libudev-compat documentation (Was: Remarks on vdev, Eudev, Mdev)

2022-06-15 Thread aitor

Hi again,

On 14/6/22 13:39, aitor wrote:

Hi,
On 11/6/22 14:07, aitor wrote:

I started documenting libudev-compat in my website as part of the documentation 
about vdev:
https://www.gnuinos.org/libudev-compat/  

This documentation is a work in progress.

Jude Nelson was wondering whether or not is possible to use `sendfile(2)`:
*ssize_t sendfile(int */out_fd/*, int */in_fd/*, off_t **/offset/*, size_t 
*/count/*); *
in the function:
static int udev_monitor_fs_push_event( int fd, struct udev_monitor* monitor 
);
of the file:

https://github.com/jcnelson/vdev/blob/master/libudev-compat/libudev-fs.c  


If you read his comment between the lines 759-771:


// send the contents of a file containing a serialized packet to the 
libudev client:
// * read the contents
// * send it along to the receiving struct udev_monitor
// NOTE: The file format is expected to be the same as a uevent packet:
//   * all newlines (\n) will be converted to null (\0), since that's 
how
// the kernel sends it.
//   * the buffer is expected to be at most 8192 bytes long.
// return 0 on success
// return -errno on failure
// return -EMSGSIZE if the file is too big
// return -EBADMSG if the file is invalid
// return -EAGAIN if we'd block on send
// TODO: can we use sendfile(2)?


The use of `sendfile` would imply to convert the function below (used by 
`udev_monitor_fs_push_event`):

    // send udev_device along
// TODO: sendfile(2)?
rc = udev_monitor_send_device( monitor, NULL, dev );
if( rc < 0 ) {
   log_error("udev_monitor_send_device rc = %d", rc );
    }
    else {
   rc = 0;
    }
into something like this:
    off_t offset = 0;

    // send file descriptor

    rc = sendfile( monitor->sock_fs, fd, &offset, BUFSIZ );
    if( rc < 0 ) {
   
   rc = -errno;

   log_error("udev_monitor_send_device rc = %d", rc );
    }
    else {
   
   rc = 0;

    }

Other modifications would be required in the receiver side, of course.

According to the description in the Linux Man Page:

https://man7.org/linux/man-pages/man2/sendfile.2.html  


*sendfile*() copies data between one file descriptor and another.
Because this copying is done within the kernel,*sendfile*() is
more efficient than the combination ofread(2)  
  andwrite(2)  
,
which would require transferring data to and from user space.
Well, I've been trying to make such improvement in libudev-compat, and 
appearently it's working fine.
So, I'll update my git repository soon.
... And again: if you catch some inaccuracy or glaring error in my 
documentation,
please let me know and I'll update it.



I pushed the commit to gitea.devuan.dev, but now i'm stuck in how to integrate 
eventfs in libudev-compat.
I do understand how it works and the example given by Jude Nelson in the 
README.md file works for me. The
problem I have is related to the insufficient space if I mount eventfs within a 
tmpfs filesystem (whether
`/tmp/test` or `/dev/metadata/udev/events`), independently of the value given 
to `default_max_bytes` in
the config file of eventfs, to the point where I can't even receive a single 
uevent packet!

Any hints?

I think I'll make a brief pause here... :(

Thanks,

Aitor.


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] libudev-compat documentation (Was: Remarks on vdev, Eudev, Mdev)

2022-06-15 Thread aitor

Hi,

On 15/6/22 13:00, aitor wrote:

I pushed the commit to gitea.devuan.dev, but now i'm stuck in how to integrate 
eventfs in libudev-compat.
I do understand how it works and the example given by Jude Nelson in the 
README.md file works for me. The
problem I have is related to the insufficient space if I mount eventfs within a 
tmpfs filesystem (whether
`/tmp/test` or `/dev/metadata/udev/events`), independently of the value given 
to `default_max_bytes` in
the config file of eventfs, to the point where I can't even receive a single 
uevent packet!
Any hints?

I think I'll make a brief pause here... :(


Well, I think I need to have a look at the following init scripts:

mountdevsubfs.sh
umountfs
umountnfs.sh

to see how to handle nested filesystems.

Cheers,

Aitor.

 

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] starting mysql in background ?

2022-06-15 Thread Simon
Radisson via Dng  wrote:

> i would like to start my mysqld 8.0 in background because it takes
> several minutes to start.

Under what init/process manger setup ?

If under SysVInit, then I would suggest you could simply modify the relevant 
init scripts to not wait for the process to fully start - i.e. just return 
success as soon as it looks like it is starting normally. But you’ll also need 
to modify anything that depends on mysql such that it will wait for it to be 
available rather than just the init script having exited normally.

There is an argument that the correct way to start processes is to simply start 
them all at once (zero attempt at sequencing) - and have the beginning of each 
script (or other config mechanism) be a “wait until my prerequisites (however I 
define them) to be available” step.

Simon

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] starting mysql in background ?

2022-06-15 Thread Ken Dibble

On 6/15/22 03:10, Radisson via Dng wrote:

Hello list,
i would like to start my mysqld 8.0 in background because it takes
several minutes to start.

Does someone have a solution ?

re,
 pr
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Disclaimer:

I know nothing about mysql and next to nothing about databases.


I found the startup time rather intriguing as Postgres starts nearly 
instantaneously.



I found this reply to a similiar post on stackexchange.

>I have a large ibdata1 file (20GB) even with file per table activated

>Turned out that mysql scan all the undo looking for uncommitted 
transactions.
>Since I had a very large undo space in the ibdata, I moved to use undo 
tablespaces. Setting up the >undo truncate option keeps my undo 
tablespace very small.

>Now my db opens in 2-3mn top!

Now, why any database leaves uncommitted transactions around after 
shutdown is a question for another time.


Hope this was of some value.


Regards,

Ken

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] starting mysql in background ?

2022-06-15 Thread Ludovic Bellière via Dng

Hello Radisson.

SysVinit (package sysv-rc) should comes with the software `startpar` as
dependency. `startpar` is a means to run processes in parallel, which
may be what you are looking for. Please check the manual: `man 1
startpar`.

The software should be used by default by SysVinit. As others have
noted, it is MySQL's fault for taking so long to start. It should also
be MySQL's duty to defer its heavy duty process.

Without more information as to the nature of your problem, that is why
it takes so long for MySQL to start, there are limited venues for us to
help you.

--
Cheers,
Ludovic

On Wed, 15 Jun 2022, Radisson via Dng wrote:


Hello list,
i would like to start my mysqld 8.0 in background because it takes
several minutes to start.

Does someone have a solution ?

re,
pr


signature.asc
Description: PGP signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng